To start a new game, we will create a new method in the game
class. Follow the given steps:
StartNewGame
.Method StartNewGame:Int()
Seed = Millisecs()
Score
value to 0
, as shown in the following code:Score = 0
layerTitle.SetActive(False)
layerGame.RemoveAllObjects()
CreateBall()
CreateTiles()
20
to cw-20
(the canvas width minus 20):SpawnEnemy(Rnd(20,cw-20))
1:
levelNum = 1
lifes
to 3:
lifes = 3
gmPlay
, and then close the method:gameMode = gmPlay Return 0 End