Skip to main content

Stage 4: Add Tasks to Collect

Course progressStage 4 of 10
~65 min
One game, one Trinket

Keep building in the workspace on the right.

This stage is part of the same Crewmate Task Dash project you started in Setup. Type each new code block into the Trinket rail and keep building on the last stage.

Build

task stations around the ship

Learn

how lists store several positions

Ship

collectible goals the player can visit

The big idea

A task station is just a coordinate with a drawing. A list lets the game remember many task coordinates at once.

New words
list
a collection of values stored in order
tuple
a small grouped value like `(x, y)`
distance
how far apart two positions are
collectible
an object the player can pick up or complete
Finished game target
Tasks 2/4Score 80
Crewmate playerTask stationShadow chaser

The player moves through the ship, collects tasks, and avoids the chaser. All playable shapes are drawn with Python Turtle code.

Build it

Your turn

Type, run, test

Read the code aloud before you run it. The goal is to understand what changed in the game.
Need a hint?

Add the new code to the same Trinket project. Keep previous stage code unless the stage says to replace a function.

Python code task
Write this part

main.py

Add this to your current Trinket file.

tasks = [(-190, 120), (190, 120), (-170, -120), (170, -120)]

def draw_tasks():
    task_pen = turtle.Turtle()
    task_pen.hideturtle()
    task_pen.penup()
    task_pen.color("gold")
    for x, y in tasks:
        task_pen.setposition(x, y)
        task_pen.dot(24)

draw_tasks()
Trace it

Trace the idea

  1. Each task is an `(x, y)` pair.
  2. The loop visits every task coordinate.
  3. `dot(24)` draws a simple glowing station.

Try this

Learning beat

Try this

Three short experiments. Predict before you run, then test your guess.

Predict first
Before running, predict which line will visibly change the screen first.
Compare
Change one number, run, then change it back. Which version feels more playable?
Connect
How does this stage make the final game more like a real project?

Test your stage

  • Four task dots appear.
  • Task positions are stored in one list.
  • Changing a coordinate moves one station.