Game Development Reference
In-Depth Information
C H A P T E R 11
■ ■ ■
GML: From Ninja to Pirate
Designers and artists often have to begin projects by facing the daunting prospect of a blank
page, but programmers rarely have the same problem. That's because it is nearly always
possible to reuse at least some code from previous projects. No matter how different your new
game is from your last, there are always similarities you can draw upon. In fact, some of the
“skill” of an experienced programmer can actually be the large archive of existing code they
have to borrow from in order to make new software! You'll soon find that using a text-based
programming language such as Game Maker Language (GML) makes it much easier to reuse
your code between projects in this way.
So we would need to be mad to start from scratch when it comes to making Shadows on
Deck . Zool may not have much in common with Flynn as a character, but the games are both part
of the pl atfor m game gen r e an d so shar e man y common behav ior s. Shadows on Deck may look a
lot different too, but by the end of the topic, we will have transformed colorful Sweet World into
something much more sinister and atmospheric. We certainly want to do our best to try and
realize the creative vision set out in the previous chapters, but there's nothing wrong with
taking a few shortcuts to get there.
GML Babel Fish
In the cl a ssi c sci - fi come dy , The Hitchhiker's Guide to the Galaxy by Douglas Adams (Del Ray,
1979), there is a fictitious species of fish that can translate any language. That fish was called the
Ba be l fi sh a n d r i g ht n ow we coul d do wi th on e tha t un de r sta n ds pr og r a mmi n g , too. For we ' r e
going to begin by translating our Zool “engine” from the icon-based drag-and-drop actions
(D&D) we used to create it, into the script-based Game Maker Language (GML).
The Zool game we've created has pushed drag-and-drop (D&D) programming about as far
as it can go—and in fact some of the D&D approaches we've used in the game could be more
elegantly achieved in GML. Using D&D programming to write a game is a bit like trying to tell
a story using mime. It can be an effective way to quickly express certain things, but it lacks the
precision and variety to tell the story in exactly the way you might want to. In contrast, GML
programming is more like having the full vocabulary of a language at your disposal, giving you
the power to take your story exactly where you want it to go.
We can assume by now that you're pretty good with D&D programming, but we'll also take
it for granted that you've had some contact with GML before. You don't need to be an expert, but
it will certainly help if you have done some basic tutorials in the past like those included in
Chapters 12-14 of The Game Maker's Apprentice . We're not going to teach you GML from scratch
in this topic, but we will compare and contrast GML and D&D as we go through the process of
converting the Zool game to GML. This is actually quite a good way to begin to understand the
 
Search WWH ::




Custom Search