Skip to content

Commit ca8527b

Browse files
Merge pull request #65 from raspberrypilearning/draft
Draft
2 parents 9141ea3 + 8526b9f commit ca8527b

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

en/step_2.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Open the [starter project](https://editor.raspberrypi.org/en/projects/rocket-lau
99
First, you will create a black background to represent space.
1010

1111
--- task ---
12+
1213
Define a `draw_background()` function, and set the background colour to black.
1314

1415
--- code ---
@@ -50,6 +51,7 @@ def draw():
5051
--- task ---
5152

5253
**Test:** Run your code and you should see a black square.
54+
5355
--- /task ---
5456

5557

@@ -68,8 +70,10 @@ line_highlights: 15-16
6870
def draw_background():
6971
background(0,0,0)
7072
image(planet, screen_size/2, screen_size, 300, 300)
73+
7174
--- /code ---
7275

76+
7377
The `image()` function needs the following data:
7478

7579
- image filename - we have already loaded the planet image
@@ -111,6 +115,7 @@ def setup():
111115
image_mode(CENTER)
112116
global planet
113117
planet = load_image('planet.png')
118+
114119
--- /code ---
115120

116121
--- /task ---

en/step_3.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ rocket_position = screen_size
5252

5353
The `y` position of the rocket will start at 400 (the screen height) and then decrease by 1 each time a new frame is drawn.
5454

55-
5655
--- task ---
5756

5857
Define a `draw_rocket()` function to make the rocket appear on the screen.
@@ -101,7 +100,6 @@ def draw():
101100

102101
**Test:** Run your code and check that the rocket appears at the bottom of the image.
103102

104-
105103
--- /task ---
106104

107105

@@ -112,6 +110,7 @@ Each time a new frame is drawn, you need to move the rocket one pixel up the scr
112110

113111
The `rocket_position` of the rocket will start at 400 (the screen height) and then decrease by 1 each time a new frame is drawn.
114112

113+
115114
--- code ---
116115
---
117116
language: python
@@ -124,6 +123,7 @@ def draw_rocket():
124123
global rocket_position
125124
rocket_position = rocket_position - 1
126125
image(rocket, width/2, rocket_position, 64, 64)
126+
127127
--- /code ---
128128

129129
--- /task ---
@@ -136,4 +136,5 @@ def draw_rocket():
136136

137137
![A rocket flying at a steady speed from the bottom to the top of the screen.](images/fly.gif){:width="300px"}
138138

139-
--- /task ---
139+
--- /task ---
140+

en/step_4.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Add some grey circles to simulate the exhaust trail.
1414

1515

1616
--- task ---
17+
1718
Set the fill colour for the smoke to transparent grey.
1819

1920
--- code ---
@@ -29,7 +30,6 @@ def draw_rocket():
2930
rocket_position = rocket_position - 1
3031
image(rocket, width/2, rocket_position, 64, 64)
3132
fill(200, 200, 200, 100)
32-
3333

3434
--- /code ---
3535

@@ -40,6 +40,8 @@ def draw_rocket():
4040
The outline around the circles is called the **stroke**. Add some code to turn it off.
4141

4242

43+
--- task ---
44+
4345
--- code ---
4446
---
4547
language: python
@@ -54,9 +56,6 @@ line_highlights: 15
5456

5557
--- /code ---
5658

57-
--- /task ---
58-
59-
6059
--- task ---
6160

6261
Generate a random number between 5 and 10 for the size of the circle, then draw it at the bottom of the rocket.
@@ -127,6 +126,7 @@ def draw_rocket():
127126
--- /task ---
128127

129128
--- task ---
129+
130130
Generate a random number and add it to the x and y position of each circle so they aren't all drawn in the same place.
131131

132132

@@ -150,8 +150,9 @@ ellipse(
150150
--- /task ---
151151

152152

153-
154-
155153
--- task ---
154+
156155
**Test:** Run your program and you should see lots of grey circles in random places at the bottom of the rocket.
157-
--- /task ---
156+
157+
--- /task ---
158+

en/step_6.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
55
You could:
66

77
--- task ---
8+
89
Give your smoke circles a range of different colours.
10+
911
--- /task ---
1012

1113
--- task ---
14+
1215
Make your rocket move faster or slower.
16+
1317
--- /task ---
1418

1519
--- task ---
20+
1621
Add to your animation so that the rocket reappears and lands on a different planet.
22+
1723
--- /task ---
1824

25+
--- /challenge ---
1926

20-
--- /challenge ---

0 commit comments

Comments
 (0)