GameMaker: Placing Objects in the Game Room
GameMaker: Studio has a feature called Rooms. A Room is where you place all the different parts of your game. After you finish creating and refining your resources — Sounds, Sprites, Objects (configured with Actions and Events) — you’re ready to place Instances of your Objects in the Room. But first you have to create one.
Creating a room
To create a new Room, click the Create a Room icon (which looks like a white rectangle; see this figure). The Room Properties window opens (see the second figure).
The Room Properties window has several tabs of features:
Backgrounds: Here, you can set the background color, or choose a background image that you can tile to fill the Room.
Objects: Here, you can select Objects in order to place Instances of those Objects in the Room (see the following section).
Settings: Here, you can name the Room, set the size of the Room, and set the speed of the Room. The default speed is 30 steps, which means there are 30 steps per second. Knowing the speed of the Room is useful when it comes to setting Alarms and so forth.
Tiles: Here, you can select and manually place different images to fill the background. This is different from the Backgrounds tab in that the Backgrounds tab can automatically fill the Room for you, while the Tiles tab is manual.The Room Properties window.
Putting your objects in the room
When you place an Object in the Room, it becomes an Instance of that Object. You can have several Instances of a single Object in your game.
To place an Object in a Room, follow these steps:
From the Resource tree, double-click a Room.
The Room Properties window appears (refer to the figure).
Click the Objects tab.
Click the drop-down icon indicated in the figure to select the Object you want to place an Instance of in the Room (for example, obj_wall).
The name of the Object appears in the field, and you see that Object’s assigned Sprite in the top corner of the window.
Click in the Room where you want to place an Instance of the Object.
The Sprite for the Object appears where you click. If you’re placing an Object without an assigned Sprite, you see a little blue circle with a question mark in it.