Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
11.1 Creating the Boss
Class Game Extends App
Field engine:ftEngine
Field play_layer:ftLayer
Field play_scene:ftScene
Field game_over_scene:ftScene
Field game_over_layer:ftLayer
Field player:Character
Field enemies:List<Character>
Field last_enemy_time:Float
Field next_enemy_interval:Float
Field projectiles:List<Projectile>
' Add a field to hold the final_boss character
Field final_boss:Character
' .................
' Quick method for creating the final Boss
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")
Local projectile_type:ProjectileType = New ProjectileType(1, 1000, 1, 10, 1.5)
Self.final_boss = New Character(box, projectile_type, 500, 10)
End
' ....................
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment