added moving platforms and "collectable" coins and death barrier
This commit is contained in:
11
Scripts/camera_2d.gd
Normal file
11
Scripts/camera_2d.gd
Normal 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
16
Scripts/coin.gd
Normal 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
23
Scripts/kill_zone.gd
Normal 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()
|
Reference in New Issue
Block a user