Besides using a different image, which is placed and rotated differently, spawning the enemy plane works in a similar way to spawning the player plane.
SpawnEnemy
to the game
class.Method SpawnEnemy:Int ()
enemy
field.enemy = eng.CreateImage(atlas,64,0,64,64,cw/4*3,ch/2)
0.7
.enemy.SetScale(0.7)
180
degrees and give it a speed of 8
.enemy.SetAngle(180) enemy.SetSpeed(8)
enemy.SetWrapScreen(True)
grpEnemy
and give it a radius of 24
.enemy.SetColGroup(grpEnemy) enemy.SetRadius(24)
0
and close the method.hitsC=0 canShoot=True Return 0 End
Now, you have added a method to spawn an enemy plane that will appear on the right side of the canvas, facing downwards. Call it with care! Just kidding!
3.143.4.181