1. jakso lukuvuonna 2016-2017
This time
you’re going to make a simple clicker game. This is not going to be an idle
game, instead the player competes against time and tries to score as many
points as possible. In this project you’ll need some enemies to click on. Draw
couple of them so that the game will have variety. You’ll also need a font that
suits your game and some sound effects/music.
Start with the
timer. Create a new label from the NGUI tab. Name your label and place it where
you want your timer to show. Choose your font by clicking the small circle on
the right of the font field. Test correct font size in the UI label text field
and leave the field blank.
Create a
new FSM for the timer. This time you’ll need four different states.
In the
first one you show the time left and wait 1 second before transitioning to the
next state. For this create two variables: one int variable and one string
variable. The int variable will be your time remaining so choose starting value
for it. The string will be the text that is converted from the int variable.
Choose action called convert int to string. Then place you int variable in the
int section and string variable in the string section. The set property for the
UI label. Choose text as the property type and use your string variable in the
set value section. Lastly add wait action and wait for 1 second before
continuing to the finished event FINISHED.
In the
second state you’ll decrease one second from the timer. This is done with int
operator action. Choose your int variable as integer 1 and in integer 2 write
1. From the list of operations pick subtract and store result as time.
Third state
is for comparing if the time has run out or not. Use int compare action in this
state. Choose your time variable as the first integer and write 0 to the second
integer. Then create two events yes and no. Choose no for the Equal and greater
than sections. This will make the no transition to go back to the start state.
Then choose yes for the less than so that when time is up the transition will
go to the last state.
Last state
is for losing the game in which you can load a new level for losing or just
activate an object in this scene that indicates that time’s up.
Ei kommentteja:
Lähetä kommentti