Time for action – attaching the Camera Follow behavior
The game file to import and load for this session is 5961_02_11.stencyl
.
- Go to the Dashboard tab and click on the Actor Types heading.
- Double click on the Stencyl Book Monkey.
- Click on the Behaviors button in the row of buttons at the upper-center of the screen.
- Click on the + Add Behavior button at the lower-left corner of the screen.
- In the Choose a Behavior dialog box, click on the Game option in the left-hand side panel, under the heading FROM YOUR LIBRARY.
- Locate the Camera Follow behavior and double-click on it.
- Do not change the scroll speed attribute in the behavior configuration screen!
- Test the game and try to make the monkey run off the right edge of the screen—run around and see how far the monkey can go!
What just happened?
Attaching the Camera Follow behavior to an actor forces the scene to scroll whenever the actor tries to pass the center of the current screen view. Once our actor reaches either the leftmost or rightmost edge of the scene, it will stop scrolling, which allows our actor to move to the edge of the scene.
It would be a good exercise to test our game again, just to be sure that we are familiar with the way in which the Camera Follow behavior allows the actor to move around the wide jungle scene.
Adding some interesting scenery
Although we now have the basic game mechanics in place, we don't yet have a very interesting design for our platform game—our monkey can only run to left and right, but there are no obstacles!
Our next task is to add some detail to the scene, starting with additional tiles to make the scene more fun for our players:
Have a go hero – adding some interesting tiles to the scene
The game file to import and load for this session is 5961_02_12.stencyl
.
We already know how to add tiles to a scene but, before starting, we just need to make sure that:
- We are viewing the Jungle scene in the Scene Designer
- We have clicked on the Tiles button in the palette, in the panel on the right-hand side of the screen, so we can see the tileset
Go ahead and add some tiles from the tileset—it really doesn't matter too much, what the scene looks like, as long as the monkey can run around and jump without too many obstructions. There's an example of the left-hand side part of the scene in the following screenshot:
Don't forget to scroll along scene in the Scene Designer, and add platforms and obstructions along the whole length of the scene. Remember that, to view the whole width of the scene, we can use the zoom tools on the left-hand side of the Scene Designer.
Note
Do include the green pillars at the leftmost and rightmost edges of the scene, as shown in the following screenshot, which shows the whole scene, as these pillars are used in a later session.
Fine-tuning the level design
When creating a platform game we'll often find that it is too hard, too easy, or just too frustrating!
The skill of the game designer is to ensure that the players of our game will find it fun—there's no point making it ridiculously difficult, because the player will give up and move on to another game very quickly. Equally, we need to make sure that the game is not too easy to complete, otherwise the game will be finished very quickly.
While designing the layout of the game, it is important to test our progress very frequently. Make sure that it is possible for the monkey to navigate the whole length of the scene, and try to introduce some interesting challenges along the way.
The following screenshot shows an example of a level design which is not too difficult, but which has some interesting challenges. For example, if the player decides to make the monkey take the easiest route, and run along the floor of the jungle, then it will soon hit the walls of an old ruined temple, and have to run back to jump up the platforms to get over the ruins!
If this was a time-based platform game, with a countdown and bonus points for finishing the level quickly, then this is the type of challenge that can encourage a player to play the same level over and over until they can complete it in the shortest time, and gain maximum bonus points!
Finding game testers
The life of a game developer can be an isolated one! It's very easy to become lost in the development of a game without taking time out to look at it from someone else's point of view.
For this reason, it's a good idea to find someone else to test our game designs for us—it could be a friend, colleague, or a family member, but it is important to watch and listen to others while they test the game and, most importantly, make notes about what they say, so that we can improve the design of the game and make it more fun!