godot-shooter / change-html-template / files / SpeedPowerUp.gd
Branch change-html-template · default branch · all branches
SpeedPowerUp.gd
| 1 | extends Node2D |
| 2 | |
| 3 | export var speed_amount = 10 |
| 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("speed_up"): |
| 10 | body.speed_up() |
| 11 | $AnimationPlayer.play("fade_out") |