Game Development Reference
In-Depth Information
Figure 10-3 shows what would be copied to the output canvas to shows the parts for tile first and
thirteenth tiles for both the rows and the columns.
Figure 10-3. The buffer Rectangle that is copied to the canvas BitmapData
The shaded portion of Figure 10-3 is the actual area copied from the buffer to the output canvas.
It represents the actual x and y coordinates of the camera and the offsets from the left top of the
first tile. This is why the buffer needs to be 13 rows and 13 columns. We use this technique to
product smooth tile-based blit scrolling for our game.
Creating the game world
The game world for Drive She Said will once again consist of tiles from Ari Feldman's Spritelib
GPL. We have taken a few different sprites from his various sheets to create the tile sheet. We
have modified some of them to fit our own needs, so you won't find all of these exact tiles in his
library. You will also notice that we have created some tiles with angled walls. Tiles that don't fill
up the entire tile space usually prove to be a challenge when using tile-based collision detection.
We are going to use some relatively simple tricks to mitigate this challenge, but in doing so, we
will also create some simple constraints on level design. We'll discuss these details soon. First,
let's look at the tile sheet.
Creating the Tile Sheet
Figure 10-4 shows the 32
32 tile sheet that we will be using for our game.
Search WWH ::




Custom Search