Game Development Reference
In-Depth Information
Setting up the turrets
Now that we have a level, we need to add a turret. Double-click on the background, select
add sprite, and then add the graphic. Make sure that the dimension of this graphic is
32
by
32
; everything that we had set up earlier needs to be on this grid. Your playing area should
look like the following screenshot:
First, we will add some functionality using the following steps:
1. Add a
Touch
object from the
Insert New Object
window.
2. Then, go to your event sheet and add an event. This event is going to be a
Touch
event. Remember that touch events and mouse clicks are the same.
Tip
It's better to set up the touch event for simple clicks. Now, people on mobile
devices can play your game.
3. When we touch the black area, a turret is spawned. This will spawn a turret on the
screen. Add an
On touched object
event, as shown in the following screenshot: