Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging draft #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Binary file modified en/images/add-fish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified en/images/speed-variable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions en/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ last_tested: '2020-08-17'
steps:
- title: Introduction
- title: Move the shark
- title: Add plastic waste
completion:
- engaged
- title: Add plastic waste
- title: Monitor the shark's health
- title: Feed the shark
completion:
- internal
- title: Feed the shark
completion:
- external
- title: Share your project
- title: What next?
- title: What can you do now?
36 changes: 1 addition & 35 deletions en/step_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Use Scratch to create a game and save the shark! Explore sharks' favourite food source (fish, not humans!), as well as the impact of plastic in the water harming sharks in their natural ocean habitat.

This game engages with two of the United Nations Sustainable Development Goals: [Life Below Water](https://www.undp.org/sustainable-development-goals#below-water){:target="_blank"} and [Responsible Consumption and Production](https://www.undp.org/sustainable-development-goals#responsible-consumption-and-production){:target="_blank"}.

### What you will make

--- no-print ---
Expand All @@ -22,39 +20,7 @@ Click to the left and right of the shark to move it. Try to eat the fish and avo

--- /print-only ---

--- collapse ---
---
title: What you will need
---

#### Hardware

+ A computer or tablet capable of running Scratch

#### Software
### What you will need

+ Scratch 3 (either [online](https://scratch.mit.edu/){:target="_blank"} or [offline](https://scratch.mit.edu/download){:target="_blank"})

--- /collapse ---

--- collapse ---
---
title: What you will learn
---

+ How to use `random`{:class="block3operators"} numbers to change costumes and alter the behaviour of `clones`{:class="block3control"}
+ How to generate and delete `clones`{:class="block3control"}
+ How to create a game to raise awareness about an environmental issue

--- /collapse ---

--- collapse ---
---
title: Additional information for educators
---

You can [find the completed project here](https://rpf.io/p/en/save-the-shark-get){:target="_blank"}.

If you need to print this project, please use the [printer-friendly version](https://projects.raspberrypi.org/en/projects/save-the-shark/print){:target="_blank"}.

--- /collapse ---
29 changes: 22 additions & 7 deletions en/step_2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Move the shark

In this step, you will add code to allow the player to use a mouse to control the motion of a shark on the Stage.
Add code to allow the player to use a mouse to control the motion of a shark on the Stage.

--- task ---

Expand Down Expand Up @@ -44,23 +44,38 @@ if <mouse down?> then

--- /task ---

If the user clicks the mouse on the left-hand side of the **Shark** sprite's position, then the **Shark** sprite should move to the left.

--- task ---

If the user clicks the cursor closer to the left-hand side of the Stage than the **Shark** sprite's position, then the **Shark** sprite moves to the left.
Add an `if`{:class="block3control"} block inside the `forever`{:class="block3control"} loop, with the condition `mouse x`{:class="block3sensing"} is `less than`{:class="block3operators"} the `x position`{:class="block3motion"} of the **Shark** sprite.

![shark sprite](images/shark-sprite.png)
```blocks3
when flag clicked
go to x: (0) y: (-120)
forever
if <mouse down?> then
+if <(mouse x) < (x position)> then
end
next costume
```

--- /task ---

This action is possible because the position of the cursor along the x axis is stored in the `mouse x`{:class="block3sensing"} block.
--- task ---

To get the program to respond to where the user clicks, add the following blocks: `if`{:class="block3control"} `mouse x`{:class="block3sensing"} is `less than`{:class="block3operators"} the `x position`{:class="block3motion"} of the **Shark** sprite, `then`{:class="block3control"} the sprite should `change x by`{:class="block3motion"} `-10` to move to the left:
Inside the `if`{:class="block3control"} block, add a `change x by`{:class="block3motion"} block and set the value to `-10` to move the **Shark** sprite to the left.

![shark sprite](images/shark-sprite.png)

```blocks3
when flag clicked
go to x: (0) y: (-120)
forever
if <mouse down?> then
+if <(mouse x) < (x position)> then
change x by (-10)
if <(mouse x) < (x position)> then
+change x by (-10)
end
next costume
```

Expand Down
69 changes: 62 additions & 7 deletions en/step_3.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Add plastic waste

In this step, you will add plastic waste to your game.
Add plastic waste to your game, for the player to avoid.

In the Sprite list below the Stage, click on the sprite that looks like a plastic bottle. This sprite has four costumes: a bottle, a wrapper, a bag, and a plastic can holder.

Expand Down Expand Up @@ -62,25 +62,80 @@ You want the plastic to move towards the bottom of the Stage at a `random`{:cla

--- task ---

Set the `speed`{:class="block3variables"} to be a `random`{:class="block3operators"} number. Use a `repeat until`{:class="block3control"} block which will detect when a clone reaches `-180` on the y axis (the bottom of the stage). Move the clone down the Stage using the `speed`{:class="block3variables"} variable. And finally, add a `wait`{:class="block3control"} block with a value of `0.1` seconds so you can see the movement:
Set the `speed`{:class="block3variables"} to be a `random`{:class="block3operators"} number. Add a `set speed to`{:class="block3variables"} block below the `go to x: y:`{:class="block3motion"} block and set it to `pick random -1 to -10`.

![plastic sprite](images/plastic-sprite.png)

```blocks3
when I start as a clone
show
switch costume to (pick random (1) to (4)
switch costume to (pick random (1) to (4))
go to x: (pick random (-200) to (200)) y: (200)
+set (speed v) to (pick random (-1) to (-10))
```

--- /task ---

--- task ---

Add a `repeat until`{:class="block3control"} block below the `set speed to`{:class="block3variables"} block. Use the condition `y position < -180` to detect when the clone reaches the bottom of the stage.

![plastic sprite](images/plastic-sprite.png)
```blocks3
when I start as a clone
show
switch costume to (pick random (1) to (4))
go to x: (pick random (-200) to (200)) y: (200)
set (speed v) to (pick random (-1) to (-10))
+repeat until <(y position) < (-180)>
change y by (speed)
wait (0.1) seconds
end
```

--- /task ---

--- task ---

Inside the `repeat until`{:class="block3control"} block, add a `change y by`{:class="block3motion"} block and set it to `speed`{:class="block3variables"} to move the clone down the stage.

![plastic sprite](images/plastic-sprite.png)
```blocks3
when I start as a clone
show
switch costume to (pick random (1) to (4))
go to x: (pick random (-200) to (200)) y: (200)
set (speed v) to (pick random (-1) to (-10))
repeat until <(y position) < (-180)>
+change y by (speed)
end
```

--- /task ---

--- task ---

Below the `change y by`{:class="block3motion"} block, add a `wait`{:class="block3control"} block and set it to `0.1` seconds so the movement is visible.

![plastic sprite](images/plastic-sprite.png)
```blocks3
when I start as a clone
show
switch costume to (pick random (1) to (4))
go to x: (pick random (-200) to (200)) y: (200)
set (speed v) to (pick random (-1) to (-10))
repeat until <(y position) < (-180)>
change y by (speed)
+wait (0.1) seconds
end
```

--- /task ---

Run your game, and you should see the plastic waste falling from random positions and at random speeds from the top of the Stage. The problem is that the waste accumulates at the bottom of the Stage, and stays there.
--- task ---

Test your code.

Run your game by clicking the green flag, and you should see the plastic waste falling from random positions and at random speeds from the top of the Stage. The problem is that the waste accumulates at the bottom of the Stage, and stays there.

--- /task ---

--- task ---

Expand Down
2 changes: 1 addition & 1 deletion en/step_4.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Monitor the shark's health

In this step, you will use a `variable`{:class="block3variables"} to include health points. The health of the shark will reduce if it accidentally eats plastic waste.
Use a `variable`{:class="block3variables"} to include health points. The health of the shark will reduce if it accidentally eats plastic waste.

--- task ---

Expand Down
25 changes: 18 additions & 7 deletions en/step_7.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
## What next?

In this project, you have:
+ Picked `random`{:class="block3operators"} numbers to change the costumes and behaviour of `cloned`{:class="block3control"} **Plastic** and **Fish** sprites
+ Learned how to generate and delete `clones`{:class="block3control"} so that they appear to fall away
+ Created a game that raises awareness about the harm caused to sharks by plastic in the oceans
## What can you do now?

If you have been following the [Protect our planet](https://projects.raspberrypi.org/en/pathways/protect-our-planet) projects, then try out the project [Tree life simulator](https://projects.raspberrypi.org/en/projects/tree-life-simulator).

Did you enjoy the project? Have you spotted a mistake? Please click the **Send feedback** button below and let us know!
--- no-print ---

Click on the green flag and then move the slider to alter the tree management levels. Click on the tree feller to request wood. Keep an eye out for natural disasters though — they’re very disruptive!

<div class="scratch-preview">
<iframe src="https://scratch.mit.edu/projects/431800781/embed" allowtransparency="true" width="485" height="402" frameborder="0" scrolling="no" allowfullscreen></iframe>
</div>

--- /no-print ---

--- print-only ---

![Complete project](images/showcase_static.png)

--- /print-only ---

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