Game Development Reference
In-Depth Information
Players
Each of those icons represent the individual players in this game. To keep things
as simple as possible, there are only two players in the game: you (the hero), and
Mr. Snooty McSnootington (the enemy). Additionally, we could have very easily ad-
ded functionality to the options widget to allow the player to choose specific icons for
both, the hero and the enemy, since the code that controls what icons are used is a
simple CSS class that can be added to or removed from the icon objects.
The main container
This section of HTML holds the elements that control the game, which is everything
below the sky widget.
Words to write
Here is where we display the words that the user must type when the game starts.
Behind the scenes, this is a simple block-level HTML element, whose only purpose
is just to display a few words.
Words written
Although, this widget is identical to the words to write widget (with slightly different
styling, of course), this widget is a bit more dynamic, as it will respond to user ac-
tions. When a user presses a key on the keyboard, that input will be displayed there.
If the character typed matches the expected character based on whatever is shown
in the Words to write widget, then the character is displayed in white. If the charac-
ter is incorrect, it'll be displayed in red, with a line through it, indicating very strongly
that a mistake was made. The user can use the Backspace key to delete any or all
characters displayed in this widget. As each correct character is typed in, the hero
will move to the right proportionally to the percentage of characters entered, relative
to the total amount to be typed.
Search WWH ::




Custom Search