Created
January 14, 2017 15:26
-
-
Save codetravis/e89e9bfc6a4f4f6b6032788eb38e0fc0 to your computer and use it in GitHub Desktop.
12.1 The Boss shoots back
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Game Class | |
Method OnUpdate() | |
' .............. | |
Else | |
Self.final_boss.Update(engine.GetCanvasWidth(), engine.GetCanvasHeight()) | |
' Have the Boss shoot | |
If Self.final_boss.FireProjectile() | |
CreateProjectile(final_boss) | |
End | |
End | |
End | |
'.............. | |
Method CreateFinalBoss() | |
Local box:ftObject = Self.engine.CreateBox(120, 200, engine.GetCanvasWidth() - 10, engine.GetCanvasHeight()/2) | |
box.SetColor(255, 0, 255) | |
box.SetMaxSpeed(20.0) | |
box.SetMinSpeed(-20.0) | |
box.SetColGroup(ENEMY_GROUP) | |
box.SetColWith(PLAYER_GROUP, True) | |
box.SetText("FINALBOSS") | |
' changing boss projectile speed | |
Local projectile_type:ProjectileType = New ProjectileType(1, 1000, 1, 25, 1.5) | |
Self.final_boss = New Character(box, projectile_type, 500, 10, "FINALBOSS") | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment