Game Development Reference
In-Depth Information
3. Next, add the set <ghost> effect to () % block (with the value 100 ) to make the
control sprite completely transparent. It is sill there and will interact with all of the
other objects on the stage. It has just become invisible.
4. Place the control sprite at its staring posiion with a go to x: () y: () block. Aim for
the irst staring bracket at the right side of the track. I used the values 192 and -27
respecively.
5. Insert a point in direcion () block with value 0 or straight up. The control sprite is
now ready to start moving. To move forward, we will use a speed variable that will
make the kart move automaically.
6. Navigate to Make a variable and make a variable named speed1 .
7. Grab a forever block and place it underneath the script we already wrote.
8. Inside the loop, place an if () then block. We will use this to check if we have
reached top speed.
9. Inside the condiion slot, place a speed1 < () block (with the value 4 ).
10. If the speed is not yet 4 , we will increase it using the change <speed1> by () block
(with the value 0.2 ).
11. Atach a move () steps block underneath the if () then block and place the speed1
variable in the vacant slot to set the kart in moion.
12. Add a wait () secs block (with the value 0.1 ) to keep the kart under control. It
responds way too fast if the script is not reduced by a bit.
The following screenshot shows the final script:
 
Search WWH ::




Custom Search