Chapter 4. Creating Behaviors
In Chapter 3, Detecting Collisions, we configured collision shapes for the actors and tiles so that collisions are detected when required, and our game now allows the player to traverse the scene with some basic, predictable interactivity. However, although the monkey is now colliding with other actors, there are currently no responses to these collisions, other than a bump when some of the actors collide.
We need to take control of the game, so in this chapter, we're going to learn how to create instructions that will carry out specific actions when collisions and other events occur within our game.
In this chapter we will be:
Creating custom behaviors
Understanding the instruction block palette
Creating a timed event
Examining screen size and scene size
Introducing randomness into our game
Implementing our first special effect
Understanding active actors
Creating a countdown timer
Implementing decision making in our game
Repositioning an actor during gameplay
Triggering...