Last active
December 22, 2016 13:16
-
-
Save codetravis/258687ff1866e61c0493ec1e901f5a13 to your computer and use it in GitHub Desktop.
8.16 Add point value and points earned to Character class
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
Import fantomX | |
Import projectile_type | |
Class Character | |
Field box:ftObject | |
Field current_health:Int | |
Field max_health:Int | |
Field is_player:Bool | |
Field projectile_type:ProjectileType | |
Field last_projectile_time:Float | |
' Give characters a point value and points earned field | |
Field point_value:Int | |
Field points_earned:Int | |
' Add the point value in the constructor | |
Method New(box:ftObject, projectile_type:ProjectileType, point_value:Int=5, health:Int=1, player:Bool=False) | |
Self.box = box | |
Self.current_health = health | |
Self.max_health = health | |
Self.is_player = player | |
Self.projectile_type = projectile_type | |
Self.last_projectile_time = Millisecs() | |
' initialize the point value and points earned fields | |
Self.point_value = point_value | |
Self.points_earned = 0 | |
End | |
'.................... | |
' Simple method for increasing the score | |
Method IncreaseScore(points:Int=0) | |
Self.points_earned += points | |
End | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment