added moving platforms and "collectable" coins and death barrier

This commit is contained in:
2024-09-07 13:13:05 -04:00
parent 709cee6893
commit 1573768619
12 changed files with 282 additions and 19 deletions

11
Scripts/camera_2d.gd Normal file
View File

@@ -0,0 +1,11 @@
extends Camera2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

16
Scripts/coin.gd Normal file
View File

@@ -0,0 +1,16 @@
extends Area2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_body_entered(body: Node2D) -> void:
print("coin touched")
queue_free()

23
Scripts/kill_zone.gd Normal file
View File

@@ -0,0 +1,23 @@
extends Area2D
@onready var timer: Timer = $Timer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_body_entered(body: Node2D) -> void:
print("you died")
timer.start()
func _on_timer_timeout() -> void:
get_tree().reload_current_scene()