Game Development Reference
In-Depth Information
Exploring Tiles and Rooms
1.
Open tile_sweet from the Background resources. It has Use as tile set selected so
Game Maker automatically subdivides it into around 500 different 16x16 pixel tiles that
you can rearrange to create the visual composition of a level. It's worth noting that,
unlike individual sprites, tiles do not have a movable origin. Their origin is effectively
always X = 0 , Y = 0 , so all the corresponding sprite collision masks (in the Platforms
group) also have their origins set to X = 0 , Y = 0 , to match up precisely with the tiles.
Open up room_test from the Room resources to see the example level we've created for
you using this tile set. If you select the settings tab, you'll see that the size of the entire
room is 2048 x 640 pixels. Have a look around using the scrollbars. It's not nearly as big
as an original Zool level, but it'll work fine for our testing purposes.
2.
3.
Now switch to the tiles tab (see Figure 3-4). From here, you can see our tile_sweet tile
set displayed in the tab on the left hand side, and the room itself on the right. You'll
need to expand the right edge of the tab by some way in order to see all of the tiles
from the tile set. You can change the currently selected tile by left clicking on the tile
set, and then place copies of that tile by left clicking in the room. As with objects, you
can also delete tiles again using the right mouse button. Have a go at creating an area
of landscape using the tile set, but be careful to undo your changes again afterward
(either by using the Undo button or by closing the room and selecting No when asked
to save the changes). You can see how much time and effort went into putting just this
small level together!
There are two separate tile layers in this room: a background layer (at a depth of 1000 ),
which will appear behind Zool, and a foreground layer (at a depth of -1000 ), which will
appear in front of Zool. This helps to give the game a more 3D effect by making Zool
appear behind some items of scenery and in front of others. You can select between
editing these different layers by clicking on the drop-down menu where it says Current
tile layer . You can only add or delete tiles from the currently selected layer.
4.
Tip To view only the tile layer you are currently editing, uncheck the Show Tiles option from the drop-
down menu next to the magnifying glass on the Room Properties toolbar (see Figure 3-4). When the tiles
tab is selected, this only shows the current tile layer. When the tiles tab is not selected, it hides all tiles.
5.
Now, switch to the objects tab in the Room Properties with the Show Tiles option still
unchecked. All the pretty graphics should disappear and you should now be able to see
through to the green collision objects that define the physically solid parts of the level.
All these collision objects have a Depth of 0 , so they appear in-between the two tile
layers (although they also have their Visible setting unchecked so they aren't visible at
all when you run the game—just in the editor).
6.
It's difficult to tell, but worth noting that we have placed additional collision objects so
that the floor extends some way beyond the left and right boundaries of the room. We
want the room to work as an infinitely looping level, so this helps Zool to smoothly
wrap around the boundaries of the room without accidently falling down outside of
the room. This also means you might occasionally get a message from Game Maker
telling you that there are objects outside of the room and asking you if you want to
delete them. Obviously, you need to select No when you get this message.
 
Search WWH ::




Custom Search