platformer-game-test/src/Items/Spring.gd
Sagi Dayan 40e752c86e Tweaks
- trying to get into the game
2020-11-25 15:07:47 -05:00

11 lines
328 B
GDScript

extends Node2D
export var thrust:float = 250
func _on_Area2D_body_entered(body: Node) -> void:
if body.is_in_group("Boostable"):
var boost_direction = Vector2.UP.rotated(rotation).round()
body.boost(boost_direction * thrust)
AudioManager.play_sfx(AudioManager.Sfx.SPRING)
$AnimationPlayer.play("activated")