Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
8.1 Include health as part of the Character class and its constructor
Import fantomX
Class Character
Field box:ftObject
' Give characters health
Field current_health:Int
Field max_health:Int
Field is_player:Bool
' Modify the New method to include health and set health, we will default this to 1
Method New(box:ftObject, health:Int=1, player:Bool=False)
Self.box = box
Self.current_health = health
Self.max_health = health
Self.is_player = player
End
' ............
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment