2020-11-05 02:13:24 +00:00
|
|
|
extends Node2D
|
|
|
|
|
2020-11-25 20:07:47 +00:00
|
|
|
export var thrust:float = 250
|
2020-11-05 02:13:24 +00:00
|
|
|
|
|
|
|
func _on_Area2D_body_entered(body: Node) -> void:
|
2020-11-25 20:07:47 +00:00
|
|
|
if body.is_in_group("Boostable"):
|
|
|
|
var boost_direction = Vector2.UP.rotated(rotation).round()
|
|
|
|
body.boost(boost_direction * thrust)
|
2020-11-06 21:05:55 +00:00
|
|
|
AudioManager.play_sfx(AudioManager.Sfx.SPRING)
|
2020-11-05 02:13:24 +00:00
|
|
|
$AnimationPlayer.play("activated")
|