This new method called SpawnEnemy
will create one enemy and initialize its position and the path to follow:
SpawnEnemy
, inside the game class. It will have the x
position as a parameter. The y
position will be fixed and always on top.Method SpawnEnemy:Int (x:Float)
Enemy
class to the enemyList
field of the game
class. The y
position is always 0
and there are 25
path nodes to be created:enemyList.AddLast(New Enemy(x,0.0,25)) Return 0 End
This method created an enemy with 25 path nodes and stored it inside the enemy list of the game
class.
18.218.212.102