Game Development Reference
In-Depth Information
else if (_selectedWord == downWord &&
_selectedTile != tile) _selectedWord =
else _selectedWord = acrossWord;
for (var i:int = 0; i < _selectedWord.length; i++) {
if (_selectedWord[i] == tile) {
Transform = tileSelectedColor;
} else {
Transform = wordSelectedColor;
_selectedTile = tile;
var wordNumber:int = _selectedWord[0].wordIndex;
if (_selectedWord == downWord) {
_crosswordClue.text = String(wordNumber) +
+ (_content.clues.down[tile.
downIndex-1] ||
} else {
_crosswordClue.text = String(wordNumber) +
" Across: " + (_content.clues.across[tile.
acrossIndex-1] || "" );
The selectTile method is called when the player clicks a tile. To
provide the expected user feedback, this method needs to (1) high-
light the selected tile, (2) highlight the word with which the tile is
associated, and (3) display the hint associated with the tile. First,
we look up the across and down words the tile is associated with
and then call clearSelection , which we will look at shortly. Suffice it
to say now that clearSelection will nullify any other currently
selected tiles. Next, we check whether the player clicked on a
blacked-out tile; if so, we clear the clue text, disable the keyboard
input if it is active, and exit the function. If the _selectedTile prop-
erty is null, meaning no tile was previously selected, we add a lis-
tener for the keyboard input so that players can start to type letters
once they click a tile. We now need to know whether to use the
s associated across or down word. By default, if no previous
word was selected, we use the tile
conditions to ensure that if a tile is selected as part of a down
word, and another tile in that word is clicked, it will keep the
same word selected. We also check to see if the same tile was
clicked twice; if so, we want to select the opposite type of the word
that is currently selected. For instance, if an across word is selected
Search Nedrilad ::

Custom Search