16 lines
358 B
GDScript
16 lines
358 B
GDScript
extends Node2D
|
|
|
|
export var value = 1
|
|
export var number = 0 #Used for saving which specific shards collected
|
|
|
|
func _ready():
|
|
$AnimationPlayer.play("glow")
|
|
|
|
func _on_Area2D_body_entered(body):
|
|
#Collect
|
|
if body.is_in_group("player"):
|
|
Audio.play_shard_sound()
|
|
Game.score += 500
|
|
Game.shards += value
|
|
Game.shards_collected[number] = true
|
|
queue_free()
|