David Steckler

The Archer's Journey: Interactive Target Practice Tutorial

Welcome, young archer! Today, we embark on a quest to create our very own archery game. Just as our ancestors used bows and arrows to hunt and protect their communities, we'll use code to bring our digital archery range to life.

Step 1: Creating Our World

Imagine standing in an open field, the sky stretching endlessly above you. This is where our journey begins. We'll start by painting the sky, just as nature does every morning.
Let's set up the canvasA blank space where we can draw and create our game for our archery range and paint the sky:
1def setup(): 2 size(400, 400) # Create a 400x400 pixel canvas 3 no_stroke() # Remove outlines from shapes 4 5def draw(): 6 fill('cyan') # Choose sky-blue color 7 rect(0, 0, 400, 250) # Draw a rectangle for the sky

In this code, we're telling the computer to create a space for our game and then fill part of it with a sky-blue color.

Canvas (400x400) Sky (400x250)
Step 1 of 13
Next Step