2022 demo
This commit is contained in:
parent
c60375cb98
commit
4727fb0f55
41 changed files with 761 additions and 68 deletions
19
objects/exit/exit.gd
Normal file
19
objects/exit/exit.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
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"))
|
Loading…
Add table
Add a link
Reference in a new issue