Game Development Reference
In-Depth Information
language, as it allows you to connect your existing understanding of Game Maker with this new
way of programming.
■
Tip
If you own
The Game Maker's Apprentice
and feel a bit rusty on GML, then now would be a great
time to go back through at least chapters 12 and 13.
So l e t' s be g i n by ope n i n g the fi l e
zooldrag.gmk
from the
Chapter11/Games
directory on the
CD. It should seem pretty familiar, but open up one of the object resources and look at the
actions list for each event. Instead of all the actions you might expect to see there, you will see a
single action called
Execute Code
. This action allows sequences of GML instructions to be
included in events as a direct replacement for lists of actions. Open
obj_zool_air
and select the
Collision
event with
obj_solid
. Double-click on the
Execute Code
action to open up the code
editor and reveal the GML code (see Figure 11-1).
Figure 11-1.
The code editor for an Execute Script action with the equivalent drag-and-drop actions
Here are a few basic reminders about working with GML:
•
GML is written in a code editor, which is basically just a text editor similar to
Windows Notepad. You have to type in the commands that you want Game Maker to
execute, in the order that you want them to happen.
•
Game Maker has to read and interpret the commands that you type into the code
editor and (as in all programming languages) it doesn't tolerate mistakes! So if you
mistype something or get the “punctuation” of the language wrong, then it usually
won't work at all, or worse, may behave differently from how you intended.
Search WWH ::
Custom Search