FillTiles
inside the game
class.Method FillTiles:Int()
Local filled:Bool = False Local filled2:Bool = False
For Local r:Int = rows To 1 Step -1 For Local c:Int = columns To 1 Step -1
filled2
to False
and check if the tile map is in the initial position (= -1)
.filled2 = False If tileMap[c-1][r-1] = -1 Then
If r > 1 Then
For Local r2:Int = r-1 To 1 Step -1
GetObjAt
.Local obj:ftObject = layerGame.GetObjAt(c*64, r2*64)
If obj <> Null And obj.GetTransitionCount()=0 Then
filled
with True
, as we've now found a gem that needs to be moved to our empty slot.filled = True
g.SetSlotTile(g.GetSlotX(obj), g.GetSlotY(obj),-1)
99
.obj.CreateTransPos(c*64.0,r*64.0,300,False, 99)
filled2
to True
and exit the method. Close the IF check and the FOR loop.filled2 = True Exit Endif Next
filled2
is False
, then no gem was found above. Set filled
to True
.If filled2 = False Then filled = True
CreateTile
.Local newObj:=CreateTile(x,0)
newObj.CreateTransPos(c*64.0,r*64.0,300,False, 99) Endif
1
, then set filled
to True
and directly add a new gem tile.Else filled = True Local newObj:=CreateTile(c,0)
newObj.CreateTransPos(c*64.0,1*64.0,300,False,99)
Endif Endif Next
filled
is set to True
, then exit the method.If filled = True Then Exit
Next Return 0 End
3.16.147.124