1) a backgound is not used, instead a whole screen is used as a sprite that can be moved
2) the player is basically stationary, but that the screen sprite moves to the left or right
3) multiple scren sprites can be used to may a very long scrolling game, but you need to be carful to match the items and color of each screen sprite used
The basic process is demonstarted below that was shown to the stduents this week. Students were actively involved with many starting , and some completing a basic game in under an hour. We even had someone scrooling up and down !!!. Keep going and let me know what your create . Please post comments.
Scrolling game concepts. See Figure 1,2 and 3 for an outline to creat a basic scrolling game. I have used the Cat and changed the costume to make him look like he is moving , but only when the arrow keys are pressed. Create a ScrollX variable. This is used to set the current location of the screen sprite. Change the ScrollX variable by a NEGACTIVE number when moving to the right and a POSITIVE number when moving to the left
Figure 1: Sprite 1 (The cat or other object moving through the scene). The blocks are shown to the right. |
Figure 2 shows the Screen Sprite and the blocks required in this sprite. By setting the x-position of the screen sprite to ScrollX, the Screen Sprite moves in the OPPOSITE direction to the direction the arrow key is pressed !! This gives the illusion that the cat is moving.
Figure 2. Left most Screen Sprite (Sprite4) and the blocks required in this sprite. |
No comments:
Post a Comment