Game Development Reference
In-Depth Information
6. Include a Change Instance action that changes the Other instance (the obj_collect
instance) into obj_100pts , with Perform events .
7. Reopen obj_100pts and add a Create event.
8. Include a Set Score action ( score tab) that increases the score by 100 (that is, sets the
score Relative to 100 ).
9. Include a Speed Vertical action ( move tab) that sets Vert. Speed to -0.5 (remember, up
is negative).
10. Include a Set Alarm action ( main2 tab) that sets Alarm 0 to 30 steps (one second). This
is how long the instance will drift upward before it turns into a twinkle object.
11. Add an Alarm , Alarm 0 event and include a Change Instance action ( main1 tab) that
changes the instance into an obj_twinkle with Perform events .
12. Reopen obj_twinkle and add a Create event.
13. Include a Change Sprite action that changes into spr_twinkle , and sets the Subimage
to 0 and the Speed to 1 . This may seem unnecessary, but remember that the Create
event of obj_collect sets the Speed of the sprite to 0 (that is, not animating) and the
Change Instance action does not start it animating again automatically.
14. Add an Other, Animation End event that includes a Destroy Instance action to destroy
itself at the end of the twinkle animation.
Spoil Your Dinner
Now reopen the test room and disable the Show Tiles option (from the drop-down menu beside
the magnifying glass toolbar icon). Place numerous instances of obj_collect all around the level,
being careful not to destroy the existing platform objects as you go. Holding the Shift key down at
the same time as pressing the left mouse button will allow you to place multiple objects more
easily (provided you have a steady hand). You should be aiming to place between 50-75 instances
of obj_collect all around the level for the player to find, but many of these should be in long lines
for the player to slide into and collect in one smooth movement.
Run the game and see the result. This already adds a bit more of a purpose to the game, even if
it's somewhat artificial at the moment. However, it also reveals a real problem with the way
collisions work in our game! Try jumping on top of a long row of collectibles and see what
happens. You should find that rather than landing on his feet as you might expect, Zool slides
across the row of collectibles while hovering slightly above the ground. This isn't right!
 
Search WWH ::




Custom Search