level 2 - moving plattforms

level2 almost finished
This commit is contained in:
Jonas Braus
2024-08-02 22:44:01 +02:00
parent a4476f2ce2
commit a706375da0
18 changed files with 46260 additions and 150 deletions
+6
View File
@@ -0,0 +1,6 @@
extends RigidBody2D
@export var veloc : Vector2
func _physics_process(delta):
linear_velocity = veloc
+22
View File
@@ -0,0 +1,22 @@
extends Node2D
@onready var timer = $Timer
@export var obj : PackedScene
@export var delay : float
var instances = []
func _ready():
timer.wait_time = delay
timer.start()
func _on_timer_timeout():
var instance = obj.instantiate()
instance.position.x = 0
instance.position.y = 0
add_child(instance)
instances.append(instance)
if len(instances) > 5:
var curr = instances.pop_front()
curr.queue_free()