godot-shooter / change-html-template / files / HealPowerUp.gd
Branch change-html-template · default branch · all branches
HealPowerUp.gd
| 1 | extends Node2D |
| 2 | |
| 3 | export var heal_amount = 1 |
| 4 | |
| 5 | func _ready() -> void: |
| 6 | $AnimationPlayer.play("fade_in") |
| 7 | |
| 8 | func _on_Area2D_body_entered(body: Node) -> void: |
| 9 | if body.has_method("heal"): |
| 10 | body.heal(heal_amount) |
| 11 | $AnimationPlayer.play("fade_out") |