CHALLENGE 2: Moving Downward and Printing Once ==================================================================== TASK ---- Write a script attached to a Sprite2D that continuously moves it downward at 80 pixels per second using _physics_process. Once its position.y passes 400, print "Reached the bottom" exactly once (not on every frame after). SOLUTION CODE (attached to the Sprite2D) -------------------------------------------- extends Sprite2D const SPEED = 80.0 var has_reached_bottom: bool = false func _physics_process(delta: float) -> void: position.y += SPEED * delta if position.y > 400 and not has_reached_bottom: print("Reached the bottom") has_reached_bottom = true WHY THIS WORKS AS AN ANSWER ---------------------------- position.y += SPEED * delta is the same frame-rate-independent movement pattern from the chapter, applied to the Y axis instead of X - since Y increases downward in Godot, continuously adding to it moves the sprite down the screen over time, exactly as the task describes. The tricky part of this challenge is the "exactly once" requirement. _physics_process runs many times per second, so a plain "if position.y > 400: print(...)" would print on every single frame after the sprite passes y=400, not just the first one. The has_reached_bottom boolean flag solves this: it starts false, and the print only happens when position.y > 400 AND has_reached_bottom is still false. The moment it prints, has_reached_bottom is flipped to true, so every subsequent frame's check fails on the second condition even though position.y > 400 remains true forever after - guaranteeing the message appears exactly once.