Game Development Reference
In-Depth Information
Adding scripts to Spaceship
The Spaceship sprite can move and fire ammo at the enemies. To do so, we need to create
codes to do the following:
F
Start
F
Move
F
Shoot
F
Response
F
End
Engage thrusters
Now we are ready to equip the Spaceship with scripts, so it can be controlled.
To create the script that executes upon game iniializaion, perform the following steps:
1. Start with a
when I receive <game_start>
message block.
2. Move to the botom center of the stage and enter
0
and
100
in the
go to
x: () y: ()
block.
3.
Switch the costume to normal using the
switch costume to <>
block.
4.
Enable
go to front
and
show
.
The following screenshot shows the final script: