Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 884 Bytes

File metadata and controls

34 lines (28 loc) · 884 Bytes

Week 15 – Student Tasks: Catch the Stars

Task A: Play the game

  • Collect 10 stars
  • Notice: Score increases, star moves to new position

Task B: Modifications

  1. Change collision distance from < 20 to < 30 (easier)
  2. Change speed = 5 to speed = 7 (faster)
  3. Add more stars (create a list of stars)
  4. Change colors

Task C: Add timer (combine with Week 11 concepts!)

import time
start_time = time.time()
game_duration = 30

def update():
    global score
    if time.time() - start_time > game_duration:
        return  # Game over!
    # ... rest of code

def draw():
    # ...
    remaining = int(game_duration - (time.time() - start_time))
    screen.draw.text(f"Time: {remaining}", (WIDTH-100, 20))

Success checklist

  • Can collect stars and see score increase
  • Understand distance-based collision
  • Know what try/except does