forked from team-sg/hero-mark-2
19 lines
427 B
GDScript
19 lines
427 B
GDScript
extends Node2D
|
|
|
|
export var cost = 0
|
|
onready var label = $Label
|
|
onready var anims = $AnimationPlayer
|
|
|
|
func _ready():
|
|
anims.play("closed")
|
|
label.text = str(cost)
|
|
|
|
|
|
func _physics_process(delta):
|
|
if Game.shards >= cost:
|
|
anims.play("open")
|
|
|
|
func _on_Area2D_area_entered(area):
|
|
if area.is_in_group("player"):
|
|
if Game.score > Game.high_score: Game.high_score = Game.score
|
|
Game.change_map(load("res://maps/demo_end.tscn"))
|