Moving Walls
A game needs obstacles! We’ll use Pipes that move from right to left. To do this, we’ll keep a list of pipes and update their X position.
Pipe Patrol
Subtract from the X position to move the pipes towards the bird.
🎯
🎯
Level Goal
Move the pipes left by subtracting 5 from their X position every frame.
Logic Lab: python.py
0/3
12345678
# Inside the game loop:
for pipe in pipe_list:
pipe.centerx 5
# Create new pipes
if time_passed > 100:
new_pipe = pipe_surface.get_rect(midtop = (, 0))
pipe_list.(new_pipe)