08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Rooms<br />

object_is_ancestor(ind1,ind2) Returns whether object ind2 is an<br />

ancestor of object ind1.<br />

The following functions will give you information about a room:<br />

room_exists(ind) Returns whether a room <strong>with</strong> the given index exists.<br />

room_get_name(ind) Returns the name of the room <strong>with</strong> the given index.<br />

Note that, because rooms change during the playing of the room, there are other routines to<br />

get information about the contents of the current room.<br />

Changing resources<br />

This functionality is only available in the Pro Edition of <strong>Game</strong> <strong>Maker</strong>.<br />

It is possible to create new resources during the game. Also you can change existing<br />

resources. This chapter describes the possibilities. Be warned though. Changing resources<br />

easily leads to serious errors in your games!!! You must follow the following rules when<br />

changing resources:<br />

• Don't change resources that are being used. This will lead to errors! For example,<br />

don't change a sprite that is being used by an instance.<br />

• When you save the game during playing, added and changed resources are NOT<br />

stored <strong>with</strong> the save game. So if you load the saved game later, these might not be<br />

there anymore. In general, when you manipulate resources you can no longer use the<br />

built-in system for loading and saving games.<br />

• When you restart the game during playing, the changed resources are NOT restored to<br />

their original shape. In general, when you manipulate resources you can no longer use<br />

the action or function to restart the game.<br />

• Resource manipulation can be slow. For example, changing sprites or backgrounds is<br />

relatively slow. So don't use it during the game play.<br />

• Creating resources during game play (in particular sprites and background) easily uses<br />

huge amount of memory. So be extremely careful <strong>with</strong> this. For example, if you have<br />

a 32 frame 128x128 animated sprite and you decide to create 36 rotated copies of it<br />

you will use up 36x32x128x128x4 = 72 MB of memory!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!