The following method will search through the tile map. If a slot is filled with the value 99
that means the corresponding tile needs to be deleted.
ClearGems
into the game
class.Method ClearGems:Int()
For Local r:Int = 1 To rows For Local c:Int = 1 To columns
99
.If tileMap[c-1][r-1] = 99 Then
tileMap[c-1][r-1] = -1
64
(the image width). The ID is set to 99
.layerGame.TouchCheck(c*64.0, r*64.0, 99)
I'm sure you wondering why we use a touch check. Later, in the engine
class, we will check inside the OnObjectTouch
method for this ID and then remove the object.
Endif Next Next Return 0 End
You have created a method that will look through the tile map and initialize all slots that need to be deleted and also will take care that the corresponding gem
image object will be removed later.