Game Development Reference
In-Depth Information
1: var returned, newx, nexy;
2:
3: returned = instance_place( x, y+1, obj_lift );
4:
5: if( returned != noone )
6: {
7: newx = x+returned.hspeed;
8: newy = y+returned.vspeed;
9:
10: if( place_meeting( newx, newy, obj_solid ) != true )
11: {
12: x = newx;
13: y = newy;
14: }
15: }
This sort of code should be starting to make sense without too much explanation now, but
you can see that we are using the instance_place function again to see if Zool is standing on a
lift and using the place_meeting function to make sure the lifts movement wouldn't push him
inside something solid. We only add the lift's movement if the result is safe, which now means
Zool will fall off the lift when it pushes him up against something.
Goodbye Ninja, Hello Pirate
We have reached a very sad point in our journey, as it is finally time to say farewell to the inter-
stellar cosmos dweller that is Zool. We have learned about as much as we can from him and it's
time to trade up for a larger model—but this one only comes in black.
The scope of Shadows on Deck is much larger too, and although we'll cover some of the
implementation step-by-step, it's simply not practical to cover the whole game in this way.
We'll provide incremental versions of the game as usual, but you'll often have to load our
version at the beginning of each new section—as there will be additions we have made for you.
It will be more of a “steps and jumps” approach than taking everything step-by-step as we did
for Zool. Nonetheless, it will be good for you to go through the motions of typing in some of the
scripts when we ask you to, as it will familiarize you with the syntax and grammar of GML in a
much more direct way than just reading this topic.
 
Search WWH ::




Custom Search