revo-jailbreak/objects/collectibles/star.gd
2022-12-07 02:00:47 -05:00

15 lines
271 B
GDScript

extends Node2D
export var value = 1
func _ready():
#Sync all coinframes
$AnimatedSprite.play()
func _on_Area2D_area_entered(area):
#Collect
if area.is_in_group("player"):
Game.stars += value
#5 Star reward
if Game.stars == 5: Game.shards += 1
queue_free()