Time for action – adding a terrain collision area to the scene

The game file to import and load for this session is 5961_03_12.stencyl.

We're going to be working in the Scene Designer.

  1. Go to the Dashboard tab, click on Scenes, and double-click on the thumbnail for the jungle scene.
  2. Ensure that we can see the leftmost part of the scene (scroll all the way to the left).
  3. Click on the Add Terrain tool in the vertical toolbar which can be found at the left edge of the Scene Designer (highlighted by the dotted oval in the following screenshot):
    Time for action – adding a terrain collision area to the scene
  4. Referring to the following screenshot, click-and-drag a rectangle over the green pillar at the left of the scene, as shown:
    Time for action – adding a terrain collision area to the scene
  5. Right-click on the same Add Terrain tool on the Scene Designer toolbar and select Add Terrain (Circle) from the pop-up menu.
  6. Click-and-drag a circle over the curved section of the green pillar, as shown:
    Time for action – adding a terrain collision area to the scene
  7. If necessary, it is easy to adjust the position of the new terrain shape by clicking on the shape and using the arrow keys. If the shapes need redrawing, they can be deleted by clicking on them and pressing the Delete key on the keyboard.
  8. On the Working Mode section of the horizontal toolbar at the top of the Scene Designer, click on the Work with Tiles and Actors (globe) icon.
    Time for action – adding a terrain collision area to the scene
  9. Test the game and try to make the monkey run past the pillar at the left of the scene.

What just happened?

We have created two custom terrain collision shapes within our scene: one rectangle and one circle. The shapes were positioned to overlay scenery that did not have its own collision bounds, but we could have placed our custom terrain shapes absolutely anywhere within the scene, if required.

When testing the game, we can see that the monkey can no longer run past the green pillar at the left side of the scene; it just bumps into the pillar as though it were another actor or a collection of tiles with the appropriate collision bounds.

Have a go hero

The game file to import and load for this session is 5961_03_13.stencyl.

There is a second pillar at the rightmost edge of the scene, and this should also have custom terrain objects drawn over it so that the monkey cannot run past the pillar, to the edge of the screen.

  • Use the skills that we have just learned to draw custom terrain shapes over the pillar at the rightmost edge of the scene.

Remember to test the game regularly during the design process to ensure that the monkey can traverse the scene as planned.

What else can we improve?

When testing the latest changes, if we had controlled the monkey so that it jumped onto the various platforms and then onto the pillar, we would have found that we could make the monkey land on top of the pillar! Is that something that we want the monkey to do? If not, we'll need to make the pillars taller by moving and adding tiles in the Scene Designer. If we modify the tiles that are used to construct the pillar, then we'll also need to redraw the custom terrain shapes to cover the modified pillars.

Again, it's up to us as game designers to determine a scene layout that works, is fun and challenging (but not too challenging) for players to explore, and which does not exhibit any strange behavior, such as being able to make actors jump onto edge-of-scene markers (for example, our pillars).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.114.92