This method will do various things, from cleaning up the layers to initializing the tile map to setting the end time.
1. Start a new method called
StartNewGame
, inside thegame
class.Method StartNewGame:Int()
2. Define a local
tile
variable with the type INT.Local tile:Int = 0
3. Seed the random number generator with the current value of
Millisecs
and set the game score to0
.Seed = Millisecs() score = 0
4. Set the game mode to
gmPlay
and activate layers with it.gameMode = gmPlay ActivateLayer(gameMode)
5. To create the objects, set the default layer to
layerGame
and remove all objects form the game layer and the GFX layer.eng.SetDefaultLayer(layerGame) layerGame.RemoveAllObjects() layerGFX.RemoveAllObjects()
6. Create the tile selector and make it invisible.
selector = eng.CreateImage(atlas,64,0,64,64,0,0) selector.SetVisible(False)
7. Start two FOR loops, one for the rows and and one for the columns.
For Local y:Int = 1 To rows For Local...