This commit is contained in:
Logan 2020-07-19 19:57:34 -05:00
parent 3b8d144462
commit 3012e72613
3 changed files with 6 additions and 2 deletions

View file

@ -8,6 +8,8 @@ var health = 5
const UP = Vector2(0, -1)
var velocity = Vector2()
func get_type():
return "player"
func apply_gravity(delta, modifier = 1):
velocity.y += gravity * delta * modifier

View file

@ -15,10 +15,9 @@ func _on_Regen_timeout():
is_burnout = false
func _process(delta):
BurnoutSprite.visible = is_burnout
print(Regen.is_stopped())
if get_accurate_energy() < Energybar.max_value and Regen.is_stopped():
Regen.start()
BurnoutSprite.visible = is_burnout
func set_health(value):
Hearts.value = clamp(value, Hearts.min_value, Hearts.max_value)

View file

@ -6,6 +6,8 @@
[ext_resource path="res://ui/Energy.png" type="Texture" id=4]
[ext_resource path="res://ui/Energy Burnout.png" type="Texture" id=5]
[node name="Stats" type="CanvasLayer"]
script = ExtResource( 1 )
@ -47,6 +49,7 @@ __meta__ = {
}
[node name="Energy Burnout" type="Sprite" parent="Player UI Frame 2"]
visible = false
position = Vector2( 23, -1 )
texture = ExtResource( 5 )
offset = Vector2( 0, 0.5 )