Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions en/step_1.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## You will make

Use Python, with the `p5` graphics library, to draw a target and score points by hitting it with arrows.
Use Python, with the `p5` graphics library, to draw a target and score points by hitting it with arrows.

You will:
+ Personalise your game with **RGB colours**
+ Use **conditional statements** (`if`, `elif`, `else`) to make decisions
+ Position shapes with **x, y coordinates**

<p style="border-left: solid; border-width:10px; border-color: #0faeb0; background-color: aliceblue; padding: 10px;">
<span style="color: #0faeb0; font-weight: bold;"> RGB colours </span> have values between 0 and 255 for each of R(ed), G(reen), and B(lue). <span style="color: #800080;">Purple</span> has values R,G,B (128, 0, 128) — medium amounts of red and blue, with no green. Video game artists and graphic designers work with RGB colours.
<span style="color: #0faeb0; font-weight: bold;"> RGB colours </span> have values between 0 and 255 for each of R(ed), G(reen), and B(lue). <span style="color: #800080;">Purple</span> has values R,G,B (128, 0, 128) — medium amounts of red and blue, with no green. Video game artists and graphic designers work with RGB colours.
</p>

--- no-print ---
Expand All @@ -19,10 +19,10 @@ You will:

<div style="display: flex; flex-wrap: wrap">
<div style="flex-basis: 175px; flex-grow: 1">
Click the **Run** button below to start the game. When the dot appears on the target, click the mouse (or tap on your tablet) to fire your arrow.
Click the **Run** button below to start the game. When the dot appears on the target, click the mouse (or tap on your tablet) to fire your arrow.

Have a few goes. Your score appears in the output area below the target. How does your score change when the arrow lands on the different colours?
<iframe src="https://trinket.io/embed/python/f686c82d8a?outputOnly=true" width="600" height="560" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen>
Have a few goes. Your score appears in the output area below the target. How does your score change when the arrow lands on the different colours?
<iframe src="https://editor.raspberrypi.org/embed/viewer/python-archery-example?show_visual_tab=true" width="600" height="700" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen>
</iframe>
</div>
</div>
Expand All @@ -38,5 +38,5 @@ Have a few goes. Your score appears in the output area below the target. How doe
--- /print-only ---

<p style="border-left: solid; border-width:10px; border-color: #0faeb0; background-color: aliceblue; padding: 10px;">
The oldest evidence of <span style="color: #0faeb0; font-weight: bold;"> archery </span> comes from the Sibudu Cave in KwaZulu-Natal, South Africa. Remains of stone and bone arrowheads have been found, which date to between 60,000 and 70,000 years ago.
The oldest evidence of <span style="color: #0faeb0; font-weight: bold;"> archery </span> comes from the Sibudu Cave in KwaZulu-Natal, South Africa. Remains of stone and bone arrowheads have been found, which date to between 60,000 and 70,000 years ago.
</p>
18 changes: 9 additions & 9 deletions en/step_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ The sky and grass are made by writing code to draw coloured rectangles.

--- task ---

Open the [Archery starter](https://trinket.io/python/9973649e5c){:target="_blank"} project.
Open the [Archery starter](https://editor.raspberrypi.org/python/python-archery-starter){:target="_blank"} project.

If you have a Trinket account, you can click on the **Remix** button to save a copy to your `My Trinkets` library.

--- /task ---

The starter project has some code already written for you to import the `p5` library, you will use this library to build your archery game.
The starter project has some code already written for you to import the `p5` library, you will use this library to build your archery game.

[[[p5-processing-library]]]

--- task ---

The `fill()` function sets the inside colour of shapes. The starter project already contains some RGB colours you can use to do this.
The `fill()` function sets the inside colour of shapes. The starter project already contains some RGB colours you can use to do this.

Find your `draw()` function and prepare to draw the sky by adding indented code to set the `fill()` colour to `sky`:

Expand All @@ -44,7 +44,7 @@ def draw():
grass = color(149, 212, 122)
wood = color(145, 96, 51)
outer = color(0, 120, 180)

fill(sky)

--- /code ---
Expand All @@ -66,7 +66,7 @@ After your `fill()` code, draw a `rect()` for the sky with top-left coordinates
language: python
filename: main.py — draw()
line_numbers: true
line_number_start: 25
line_number_start: 25
line_highlights: 26
---

Expand Down Expand Up @@ -100,7 +100,7 @@ line_number_start: 23
line_highlights: 25
---

outer = color(0, 120, 180)
outer = color(0, 120, 180)

no_stroke()
fill(sky)
Expand All @@ -120,7 +120,7 @@ line_highlights: 25

`fill()` changes the fill colour for all shapes drawn until `fill()` is called again with a new colour.

Change the `fill()` colour to `grass` and add another `rect(x, y, width, height)`.
Change the `fill()` colour to `grass` and add another `rect(x, y, width, height)`.

This rectangle needs to be positioned below the sky at coordinates (0, 250), so that it starts in the lower part of the screen.

Expand All @@ -133,8 +133,8 @@ line_number_start: 23
line_highlights: 28-29
---

outer = color(0, 120, 180)
outer = color(0, 120, 180)

no_stroke()
fill(sky)
rect(0, 0, 400, 250) #x, y, width, height
Expand Down
2 changes: 1 addition & 1 deletion en/step_7.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You could:
title: Completed project
---

You can view the [completed project here](https://trinket.io/python/f686c82d8a){:target="_blank"}.
You can view the [completed project here](https://editor.raspberrypi.org/python/python-archery-example){:target="_blank"}.

--- /collapse ---

Expand Down
9 changes: 3 additions & 6 deletions en/step_8.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## What next?

If you are following the [Introduction to Python](https://projects.raspberrypi.org/en/raspberrypi/python-intro) pathway, you can move on to the [Rocket launch](https://projects.raspberrypi.org/en/projects/rocket-launch) project. In this project, you will make an interactive animation of a rocket launching a satellite into orbit.
If you are following the [Introduction to Python](https://projects.raspberrypi.org/en/raspberrypi/python-intro) pathway, you can move on to the [Rocket launch](https://projects.raspberrypi.org/en/projects/rocket-launch) project. In this project, you will make an interactive animation of a rocket launching a satellite into orbit.

--- print-only ---

Expand All @@ -12,11 +12,11 @@ If you are following the [Introduction to Python](https://projects.raspberrypi.o

--- task ---

**Try it:** Your program will adjust the animation based on how much fuel you give it and will succeed or fail in reaching orbit. How much fuel do you want to use to reach orbit but not waste too much extra fuel?
**Try it:** Your program will adjust the animation based on how much fuel you give it and will succeed or fail in reaching orbit. How much fuel do you want to use to reach orbit but not waste too much extra fuel?

**Tip:** Around 25,000kg should be enough, but experiment with the numbers to see what happens.

<iframe src="https://trinket.io/embed/python/622b4dd113?outputOnly=true&start=result" width="600" height="500" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen>
<iframe src="https://editor.raspberrypi.org/embed/viewer/rocket-launch-example?show_visual_tab=true" width="600" height="700" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen>
</iframe>

![Rocket launch project](images/showcase_rocket.png)
Expand All @@ -26,6 +26,3 @@ If you are following the [Introduction to Python](https://projects.raspberrypi.o
--- /no-print ---

If you want to have more fun exploring Python, then you could try out any of [these projects](https://projects.raspberrypi.org/en/projects?software%5B%5D=python).