11package flixel ;
22
3- import openfl .display .Graphics ;
43import flixel .group .FlxGroup .FlxTypedGroup ;
54import flixel .math .FlxPoint ;
65import flixel .math .FlxRect ;
@@ -13,6 +12,7 @@ import flixel.util.FlxDestroyUtil;
1312import flixel .util .FlxDirectionFlags ;
1413import flixel .util .FlxSpriteUtil ;
1514import flixel .util .FlxStringUtil ;
15+ import openfl .display .Graphics ;
1616
1717/**
1818 * At their core `FlxObjects` are just boxes with positions that can move and collide with other
@@ -46,7 +46,7 @@ import flixel.util.FlxStringUtil;
4646 * FlxG.overlap(playerGroup, medKitGroup
4747 * function onOverlap(player, medKit)
4848 * {
49- * player.health = 100;
49+ * player.heal( 100) ;
5050 * medKit.kill();
5151 * }
5252 * );
@@ -670,7 +670,9 @@ class FlxObject extends FlxBasic
670670 /**
671671 * Handy for storing health percentage or armor points or whatever.
672672 */
673- @:deprecated (" object.health is being removed in version 6.0.0" )
673+ #if FLX_HEALTH_NOT_DEFINED
674+ @:deprecated (" object.health is deprecated, add <haxedef name=\" FLX_HEALTH\" /> in your project.xml to continue using it" )
675+ #end
674676 public var health : Float = 1 ;
675677 #end
676678
@@ -1160,7 +1162,10 @@ class FlxObject extends FlxBasic
11601162 *
11611163 * @param Damage How much health to take away (use a negative number to give a health bonus).
11621164 */
1163- @:deprecated (" object.health is being removed in version 6.0.0" )
1165+
1166+ #if FLX_HEALTH_NOT_DEFINED
1167+ @:deprecated (" object.hurt is deprecated, add <haxedef name=\" FLX_HEALTH\" /> in your project.xml to continue using it" )
1168+ #end
11641169 public function hurt (damage : Float ): Void
11651170 {
11661171 health = health - damage ;
0 commit comments