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
xposition as a parameter. The
yposition will be fixed and always on top.
Method SpawnEnemy:Int (x:Float)
Enemyclass to the
enemyListfield of the
yposition is always
0and there are
25path 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
Things that should be done multiple times inside a game should be placed inside a function ...