0) { var newLetter = this.addMorph(this.letterSource.shift()); this.activeLetters.unshift(newLetter); i++; this.nLeftBox.setRichText(new lively.Text.Text(this.letterSource.length.toString(), {align: 'center'})); newLetter.onMouseDown = function (evt) {}; // Prevents show cursor if click } // If leftmost letter is off rack then drop it if (this.activeLetters.last().bounds().center().x < this.rack.bounds().topLeft().x) { var letter = this.activeLetters.pop(); if (letter.copyInOutbox) { // We are about to drop a letter that is used in the outbox var other = this.findCharOnRack(letter.textString); if (other) { // Found another of same letter -- switch outbox letter to use it other.copyInOutbox = letter.copyInOutbox; other.copyInOutbox.original = other; this.fillLetter(other, Color.gray); } else { var ix = this.outboxLetters.indexOf(letter.copyInOutbox); this.outboxLetters.splice(ix,1); letter.copyInOutbox.remove(); this.updateOutbox(0); } } if (letter.textString == "!") this.gameOver = true; letter.remove(); } } while (i+1 < this.activeLetters.length) { //console.log("tick2 " + i); var let2 = this.activeLetters[i+1]; // this delta keeps brders separatte (gray belt letter and black rack letter) var deltaX = (let2.bounds().topRight().x)+1 - let1.position().x; if (deltaX < 0) return; // Letter on rack bumped into another to the left // this delta letts borders merge on the rack if (i>0) deltaX += -2; let2.moveBy(pt(-deltaX, 0)); let1 = let2; i++; } }]]> 0) this.fillLetter(this.multBoxes[nLetters-1], Color.blue); this.letterScoreBox.setTextS]]> 0 && consonants.length > 0) { // Assemble letters according to their overall ratio if ( (vowels.length / (vowels.length + consonants.length)) > ratio) mixed.push(vowels.pop()); else mixed.push(consonants.pop()); } // pick up any leftovers return mixed.concat(consonants, vowels) }]]> 0) this.removeFromOutbox(this.outboxLetters.pop()); this.updateOutbox(); }]]>