I have built my own sprite sheet of my main character which I call Space Ranger. Here it is:
This character has 5 states, 4 of which are flying backward, forward, upward and downward. The fifth state is hovering at some point on the screen. So each of the four above states can go to hovering state by releasing keyboard buttons and also from hovering state you can go to above four by pressing the buttons left/A, right/D, up/W and down/S.
For each of the four states this character has two frames taken from the above spritesheet.
Open Stencyl and create new blank game, call it KeyboardControllerTest. Choose custom size of 640 x 480 and press create. Next create new actor and call it SpaceRanger.
I have taken the above screenshot to show you what's going on in Stencyl. On the left pane there are listed 5 animations which represent the 5 states of the main character. Each of the animations has two frames as stated before.
Next we will add behaviours to the main character. Click on the Behaviours tab in the middle.
Click "add behaviour" button on the left bottom of the screen. From the new window select Controls item and add 8 way movement behaviour. After you add this new behaviour you can edit it like controls, animations, check the screenshots below:
Leave all other settings default. Next is adding the main character on a scene but first we need a scene. Create new scene and call it Scene1. Leave everything default. Go back to SpaceRanger page and press "Add to Scene" button in the upper right corner. Add it to Scene1 and press File-> Save Game to save the current progress.
Note: It seems ctrl-s saves the current progress of the game but not toroughly. So always try File-Save Game option.
Now press test game button in upper right or press ctrl-enter to test you game. Try to move the astronaut with the arrow key.
This completes the first part of this tutorial.
No comments:
Post a Comment