The session tonight was mostly a catchup for two pupils who couldn't make the last two Game.lab sessions. As in Session 4, we covered moving the sprite of a man through a maze using the cursor arrow keys and collecting diamonds, for which points were scored. To make sure the man didn't get stuck in some parts of the maze, the 'Align to Grid' action was included with a grid size of 32 x 32, the same as the room grid.
The new learning in this session was to automatically display a suitable image of the man depending on the direction he was moving in. This is quite simple as all that is needed is a 'Change Sprite' action at the start of each Key Press event.
To develop the maze game a little faster, the pupils used ready-made sprites for each of the man's four directions (left, right, up and down). In addition each sprite consisted of four images which, when displayed in a sequence, make the man look as if he is walking.
The only problem with this is that the man appeared to be walking even when not moving, so a 'still man' sprite was created by using just one of the walking images. Then a new event was added to check for all the movement keys being released with the first action being 'Change Sprite' to the still man sprite.
This was just about all we did in this session, but the pupils had lots of ideas for where this game could go in the future.
No comments:
Post a Comment