godot-shooter / change-html-template / files / HealPowerUp.gd
Branch change-html-template · default branch · all branches
HealPowerUp.gd
eb5388a0 2023-11-06 Pavel Safronov | 1 | extends Node2D |
| 2 | ||
| 3 | export var heal_amount = 1 | |
| 4 | ||
6ae9f305 2023-11-07 Pavel Safronov | 5 | func _ready() -> void: |
| 6 | $AnimationPlayer.play("fade_in") | |
539576dd 2023-11-07 Pavel Safronov | 7 | |
eb5388a0 2023-11-06 Pavel Safronov | 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") |