Now that we know the structure of our tiles, we can work on the specific designs. We will create a series of tiles with different pathway designs to use as building blocks for the level generator.
This step can be done with an external image editor, such as GIMP or Photoshop. The step-by-step explanation assumes you have such a tool available. GIMP is available for free.
If you don't want to bother with other tools besides Scratch, the Classified intel section of this task will explain how you could go about drawing the tiles in the Scratch image editor.
To start drawing the tiles, we first open the image editor of our choice. We will draw twelve different sprites to create a complete set of interesting tile options. Please create the images in the following order, because this will be important later on when we create the script for the tile generator:
tile1
in an easy-to-find location. We will later import it into Scratch.Our first image will look like the following screenshot:
We go on to creating the second tile. This will be a horizontal corridor. To create the tile, we perform the following steps:
tile2
.Our horizontal and vertical corridors should look like the following screenshot:
The third tile will be a corner and we create by performing the following steps:
tile3
.To speed up the process, let's not redraw the entire image. As you might expect, there are three more corner tiles we can draw; but instead of drawing, we can just rotate the image as follows:
tile4
.The following screenshot shows all four corner tiles:
Now we have to think of another kind of corridor. How about a T-section? For this, perform the following steps:
tile7
.The last two images are unique. Perform the following steps:
tile12
.The following screenshot shows the crossroads and the open square tiles:
The open square tile is the only image where we have to fill the tile with a white background. The reason for this is that if we leave the image blank, Scratch would treat it as a 0 x 0 size image. That would cause problems for the script we will create later.
That concludes our set of images. We drew twelve variant images that can fit seamlessly together when placed side by side. The images are simple yet effective for your game. There can be no mistake about which spaces are clear and which block movement.
If you want to create the tiles with the Scratch editor, this is how you could proceed. Please keep in mind that this approach will be less accurate and can leave gaps and overlaps between tiles. Perform the following steps to create the tiles:
Note the cross hair at the center in the following screenshot. This should remain the center point for the tile, so always calculate distances from there outward:
It's easiest to first create a bounding square centered on the cross hair by performing the following steps:
18.226.187.233