Skip to content

Commit

Permalink
Merge pull request #130 from raspberrypilearning/draft
Browse files Browse the repository at this point in the history
Add empty lines for translation
  • Loading branch information
sashamishcheriakova authored Feb 21, 2025
2 parents 6323617 + a50bd91 commit d94ba23
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
5 changes: 5 additions & 0 deletions en/step_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ def draw():
--- /task ---

--- task ---

**Test:** Run your code and you should see a coloured square.

The colour is three numbers - the amount of red, green and blue. Try changing the numbers to any whole number between 0 and 255 to get a different colour.

--- /task ---

--- task ---
Expand Down Expand Up @@ -79,6 +81,7 @@ def draw():
--- /task ---

--- task ---

**Test:** Run your code and you should see the emoji appear near the bottom of the screen.

You can paste in a different emoji if you want to.
Expand All @@ -103,9 +106,11 @@ def draw_player():
text('🤠', mouse_x, 320)

--- /code ---

--- /task ---

--- task ---

Run your code and check that the player moves left and right when you move the mouse.


Expand Down
6 changes: 5 additions & 1 deletion en/step_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def draw():


--- task ---
**Test:** Run your code and you should see a cactus as well as your player.

**Test:** Run your code and you should see a cactus as well as your player.

--- /task ---

--- task ---
Expand Down Expand Up @@ -95,9 +97,11 @@ def draw_obstacles():
text('🌵', obstacle_x, obstacle_y)

--- /code ---

--- /task ---

--- task ---

**Test:** Run your code and the cactus emoji should move down the screen until it reaches the bottom.

--- /task ---
9 changes: 8 additions & 1 deletion en/step_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ def draw_obstacles():
--- /task ---

--- task ---

**Test:** Run your code and you should see the obstacle reach the bottom of the screen and then restart from the top.

--- /task ---

--- task ---

Add a line of code for a random **seed**. A seed lets you generate the same random numbers in each frame.

--- code ---
Expand All @@ -47,9 +50,11 @@ def draw_obstacles():
obstacle_y = 200 + frame_count

--- /code ---

--- /task ---

--- task ---

Update the code so that the x, y coordinates for the obstacle are generated randomly.

--- code ---
Expand All @@ -71,5 +76,7 @@ def draw_obstacles():
--- /task ---

--- task ---
**Test:** Run your code and you should see the cactus appear at a random position. Change the `1234` value inside the seed to another number and it will appear somewhere else.

**Test:** Run your code and you should see the cactus appear at a random position. Change the `1234` value inside the seed to another number and it will appear somewhere else.

--- /task ---
5 changes: 4 additions & 1 deletion en/step_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ Make sure that the code for the seed is before the loop, otherwise all of your o
--- /task ---

--- task ---

Change the number inside `range()` to control how many obstacles are created.

--- /task ---

--- task ---
--- task ---

**Test:** Run your code and you should see several obstacles.

--- /task ---
5 changes: 4 additions & 1 deletion en/step_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Recall that in the first step you created a 'safe' colour.

--- task ---

Create a variable to store the colour the player emoji is currently touching.

--- code ---
Expand Down Expand Up @@ -41,10 +42,12 @@ def draw_player():
text('💥', mouse_x, 320)

--- /code ---

--- /task ---


--- task ---
--- task ---

**Test:** Run your code and move the player. You should see the explosion emoji if your player touches an obstacle.

Make sure that in `draw()`, the line of code to `draw_obstacles()` is before `draw_player()`. If you check for collisions before drawing the obstacles in a frame, then there won’t be any obstacles to collide with!
Expand Down
29 changes: 29 additions & 0 deletions en/step_8.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,63 @@
Now it is over to you! Use the skills you have learned to finish the game.

--- task ---

Use different emojis to represent the player and the obstacles.

--- /task ---

--- task ---

Draw the player or the obstacles using shapes instead (you learned this in the [Make a face](https://projects.raspberrypi.org/en/projects/editor-make-a-face/editor){:target="_blank"} project).

--- /task ---

--- task ---

Draw the player or the obstacles using images instead (you learned this in the [Rocket launch](https://projects.raspberrypi.org/en/projects/editor-rocket-launch/editor){:target="_blank"} project).

--- /task ---

--- task ---

Change one line of code to make the obstacles move faster.

--- /task ---

--- task ---

Create a variable and add one to it each time the player crashes.

--- /task ---

--- task ---

Make the obstacles move faster after every crash.

--- /task ---

--- task ---

Add an item for the player to pick up, which disappears when the player touches it.

--- /task ---

--- task ---

Add a variable to keep track of the player's score.

--- /task ---

--- task ---

Stop the game if the player crashes.

--- /task ---

--- task ---

Display a text message on the screen to say 'Game over'.

--- /task ---

--- /challenge ---

0 comments on commit d94ba23

Please sign in to comment.