I added a moving platform. Tutorial is finished. So now the player is on their own.

This commit is contained in:
2026-06-21 20:23:22 -06:00
parent 847cafe8d7
commit bdd99c1c78
8 changed files with 239 additions and 10 deletions
+22
View File
@@ -0,0 +1,22 @@
extends TileMapLayer
var moving_up :bool = true
var speed :float = 50.0
var distance_moved :float = 0.0
var moving = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if moving:
var movement = speed * delta
if moving_up:
position.y -= movement
distance_moved += movement
if distance_moved >= 479.7:
moving_up = false
func _on_platform_body_entered(body: Node2D) -> void:
print(body)
moving = true