Game Development Reference
In-Depth Information
8. Select the End Step event and reopen the Check Object action that appears directly
before the Execute Script action that calls move_to_contact_with . Recall that this
action is checking a little bit further beneath Zool's feet to see if there is a platform
close enough to move down onto automatically without falling. We need this to be a
bit more generous for use with our lifts, so change Y to max(speed,LIFT_SPEED+1) . In
other words, this action will look at least 3 pixels below Zool's feet and further if he is
moving faster.
Now run the game and try standing on the lifts again.
Note If you're observant, then you'll have noticed that there is a tiny lag in the movement of Zool
compared to the platforms. This is because Zool checks the movement speed of the lift he is standing on
in his Begin Step event, but the lifts start moving in the Alarm event and stop moving in the Collision
event—both of which occur after the Begin Step in the order of events. That means Zool's speed is
always one step behind, and this creates the lag. You could solve this by moving the preceding actions into
the End Step event, but be wary of doing so. This would mean we were moving Zool after his collisions
have been resolved and so it would potentially allow lifts to push him into the landscape and get him stuck.
Figure 6-6. The Begin Step event of obj_zool_land
 
Search WWH ::




Custom Search