Game Development Reference
In-Depth Information
The finished script will look like the following screenshot:
Objective complete - mini debriefing
This step is simply in preparaion for the next scriping step. We just drew a simpliied copy
of the background by hand, using whichever drawing skills and tools we had available.
It can be a bit tricky, depending on how accustomed you are with digital drawing tools.
However, it is very worthwhile to spend some ime on it. With each efort you will improve
your drawing skills, and these skills will be very useful for all kinds of digital creaions, from
games to animaion. You might even learn a bit about how to edit your holiday pictures.
Dealing with collision events
Now that we have a collision mask, we can have our kart respond differently, depending
on where it is driving. When on the road, the kart will increase throtle up to full speed.
When hiing the sandbox it will be slowed down, and hiing the walls is even worse.
The kart will bounce back and completely lose momentum.
Let's build these responses with a few scripts.
Engage thrusters
We will add a series of script instrucions to the player1 sprite. We will assemble the
instrucions irst, then place the script segment at the right spot in the exising script:
1. Start with an if () then block.
2. For the condiion, we will check touching color ()? .
3.
Click on the color box and then on the sandy color of your collision mask with
the eyedropper icon.
4.
Inside the if () then block, place a set <speed1> to () block.
 
Search WWH ::




Custom Search