Player Input to start game. SD Sidescroller


I knew that i wanted the game to not start until the player inputted either one of the jump keys, this is to ensure that the game isn't quite so instant, and there is less of a chance of the player losing straight away. I did this by implementing a system whereby the bird rigid body is static and won't move until the player presses one of the input keys.



I first declared that both State, and state could be used.


I then declared the three states the game can be in.


I made sure that when the script awakes, the default state of the rigid body is set to static.


Then i had to set the states, so that when the game was in 'Waiting' the state was static, until someone inputted a key, then the state changes to 'Playing' and the player can input the jump key as normal.

Comments

Popular Posts