- Run week14.py
- Use arrow keys to move the circle
- Try moving diagonally (hold two keys at once!)
- Try to move off the edge - it stops at the boundary
- Change
speed = 4tospeed = 8(faster movement) - Change player color to
"red"or"yellow" - Change player size from
10to15 - Change background color in
screen.fill()
Hold spacebar to move faster:
def update():
global x, y
current_speed = speed
if keyboard.space:
current_speed = speed * 2 # Double speed!
if keyboard.left:
x -= current_speed
# ... rest of movement# At top:
trail = [] # List to store positions
# In update(), after moving:
trail.append((x, y))
if len(trail) > 50: # Keep last 50 positions
trail.pop(0)
# In draw(), before drawing player:
for pos in trail:
screen.draw.circle(pos, 5, "gray")- Smooth movement in all 4 directions
- Can move diagonally
- Player stays on screen
- Added speed boost or trail