diff --git a/de-DE/banner.png b/de-DE/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/de-DE/banner.png differ diff --git a/de-DE/code/code-project-example/main.py b/de-DE/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/de-DE/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/de-DE/code/code-project-example/project_config.yml b/de-DE/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/de-DE/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/de-DE/images/avery.png b/de-DE/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/de-DE/images/avery.png differ diff --git a/de-DE/images/backdrop_editor.png b/de-DE/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/de-DE/images/backdrop_editor.png differ diff --git a/de-DE/images/backdrop_menu_paint.png b/de-DE/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/de-DE/images/backdrop_menu_paint.png differ diff --git a/de-DE/images/banner.png b/de-DE/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/de-DE/images/banner.png differ diff --git a/de-DE/images/kabaddi.png b/de-DE/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/de-DE/images/kabaddi.png differ diff --git a/de-DE/images/opponent.png b/de-DE/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/de-DE/images/opponent.png differ diff --git a/de-DE/images/rename-opponent.png b/de-DE/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/de-DE/images/rename-opponent.png differ diff --git a/de-DE/images/rename-player.png b/de-DE/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/de-DE/images/rename-player.png differ diff --git a/de-DE/images/scratch-thumbnail.png b/de-DE/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/de-DE/images/scratch-thumbnail.png differ diff --git a/de-DE/images/sprite-choose.png b/de-DE/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/de-DE/images/sprite-choose.png differ diff --git a/de-DE/images/stage.png b/de-DE/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/de-DE/images/stage.png differ diff --git a/de-DE/images/variables.png b/de-DE/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/de-DE/images/variables.png differ diff --git a/de-DE/meta.yml b/de-DE/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/de-DE/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/de-DE/step_1.md b/de-DE/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/de-DE/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/de-DE/step_2.md b/de-DE/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/de-DE/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/de-DE/step_3.md b/de-DE/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/de-DE/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/de-DE/step_4.md b/de-DE/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/de-DE/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/de-DE/step_5.md b/de-DE/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/de-DE/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/de-DE/step_6.md b/de-DE/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/de-DE/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/de-DE/step_7.md b/de-DE/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/de-DE/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/de-DE/step_8.md b/de-DE/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/de-DE/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/es-419/banner.png b/es-419/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/es-419/banner.png differ diff --git a/es-419/code/code-project-example/main.py b/es-419/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/es-419/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/es-419/code/code-project-example/project_config.yml b/es-419/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/es-419/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/es-419/images/avery.png b/es-419/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/es-419/images/avery.png differ diff --git a/es-419/images/backdrop_editor.png b/es-419/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/es-419/images/backdrop_editor.png differ diff --git a/es-419/images/backdrop_menu_paint.png b/es-419/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/es-419/images/backdrop_menu_paint.png differ diff --git a/es-419/images/banner.png b/es-419/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/es-419/images/banner.png differ diff --git a/es-419/images/kabaddi.png b/es-419/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/es-419/images/kabaddi.png differ diff --git a/es-419/images/opponent.png b/es-419/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/es-419/images/opponent.png differ diff --git a/es-419/images/rename-opponent.png b/es-419/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/es-419/images/rename-opponent.png differ diff --git a/es-419/images/rename-player.png b/es-419/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/es-419/images/rename-player.png differ diff --git a/es-419/images/scratch-thumbnail.png b/es-419/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/es-419/images/scratch-thumbnail.png differ diff --git a/es-419/images/sprite-choose.png b/es-419/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/es-419/images/sprite-choose.png differ diff --git a/es-419/images/stage.png b/es-419/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/es-419/images/stage.png differ diff --git a/es-419/images/variables.png b/es-419/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/es-419/images/variables.png differ diff --git a/es-419/meta.yml b/es-419/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/es-419/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/es-419/step_1.md b/es-419/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/es-419/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/es-419/step_2.md b/es-419/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/es-419/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/es-419/step_3.md b/es-419/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/es-419/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/es-419/step_4.md b/es-419/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/es-419/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/es-419/step_5.md b/es-419/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/es-419/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/es-419/step_6.md b/es-419/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/es-419/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/es-419/step_7.md b/es-419/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/es-419/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/es-419/step_8.md b/es-419/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/es-419/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/fr-FR/banner.png b/fr-FR/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/fr-FR/banner.png differ diff --git a/fr-FR/code/code-project-example/main.py b/fr-FR/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/fr-FR/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/fr-FR/code/code-project-example/project_config.yml b/fr-FR/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/fr-FR/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/fr-FR/images/avery.png b/fr-FR/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/fr-FR/images/avery.png differ diff --git a/fr-FR/images/backdrop_editor.png b/fr-FR/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/fr-FR/images/backdrop_editor.png differ diff --git a/fr-FR/images/backdrop_menu_paint.png b/fr-FR/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/fr-FR/images/backdrop_menu_paint.png differ diff --git a/fr-FR/images/banner.png b/fr-FR/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/fr-FR/images/banner.png differ diff --git a/fr-FR/images/kabaddi.png b/fr-FR/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/fr-FR/images/kabaddi.png differ diff --git a/fr-FR/images/opponent.png b/fr-FR/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/fr-FR/images/opponent.png differ diff --git a/fr-FR/images/rename-opponent.png b/fr-FR/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/fr-FR/images/rename-opponent.png differ diff --git a/fr-FR/images/rename-player.png b/fr-FR/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/fr-FR/images/rename-player.png differ diff --git a/fr-FR/images/scratch-thumbnail.png b/fr-FR/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/fr-FR/images/scratch-thumbnail.png differ diff --git a/fr-FR/images/sprite-choose.png b/fr-FR/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/fr-FR/images/sprite-choose.png differ diff --git a/fr-FR/images/stage.png b/fr-FR/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/fr-FR/images/stage.png differ diff --git a/fr-FR/images/variables.png b/fr-FR/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/fr-FR/images/variables.png differ diff --git a/fr-FR/meta.yml b/fr-FR/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/fr-FR/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/fr-FR/step_1.md b/fr-FR/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/fr-FR/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/fr-FR/step_2.md b/fr-FR/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/fr-FR/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/fr-FR/step_3.md b/fr-FR/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/fr-FR/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/fr-FR/step_4.md b/fr-FR/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/fr-FR/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/fr-FR/step_5.md b/fr-FR/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/fr-FR/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/fr-FR/step_6.md b/fr-FR/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/fr-FR/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/fr-FR/step_7.md b/fr-FR/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/fr-FR/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/fr-FR/step_8.md b/fr-FR/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/fr-FR/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/hi-IN/banner.png b/hi-IN/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/hi-IN/banner.png differ diff --git a/hi-IN/code/code-project-example/main.py b/hi-IN/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/hi-IN/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/hi-IN/code/code-project-example/project_config.yml b/hi-IN/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/hi-IN/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/hi-IN/images/avery.png b/hi-IN/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/hi-IN/images/avery.png differ diff --git a/hi-IN/images/backdrop_editor.png b/hi-IN/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/hi-IN/images/backdrop_editor.png differ diff --git a/hi-IN/images/backdrop_menu_paint.png b/hi-IN/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/hi-IN/images/backdrop_menu_paint.png differ diff --git a/hi-IN/images/banner.png b/hi-IN/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/hi-IN/images/banner.png differ diff --git a/hi-IN/images/kabaddi.png b/hi-IN/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/hi-IN/images/kabaddi.png differ diff --git a/hi-IN/images/opponent.png b/hi-IN/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/hi-IN/images/opponent.png differ diff --git a/hi-IN/images/rename-opponent.png b/hi-IN/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/hi-IN/images/rename-opponent.png differ diff --git a/hi-IN/images/rename-player.png b/hi-IN/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/hi-IN/images/rename-player.png differ diff --git a/hi-IN/images/scratch-thumbnail.png b/hi-IN/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/hi-IN/images/scratch-thumbnail.png differ diff --git a/hi-IN/images/sprite-choose.png b/hi-IN/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/hi-IN/images/sprite-choose.png differ diff --git a/hi-IN/images/stage.png b/hi-IN/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/hi-IN/images/stage.png differ diff --git a/hi-IN/images/variables.png b/hi-IN/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/hi-IN/images/variables.png differ diff --git a/hi-IN/meta.yml b/hi-IN/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/hi-IN/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/hi-IN/step_1.md b/hi-IN/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/hi-IN/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/hi-IN/step_2.md b/hi-IN/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/hi-IN/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/hi-IN/step_3.md b/hi-IN/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/hi-IN/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/hi-IN/step_4.md b/hi-IN/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/hi-IN/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/hi-IN/step_5.md b/hi-IN/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/hi-IN/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/hi-IN/step_6.md b/hi-IN/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/hi-IN/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/hi-IN/step_7.md b/hi-IN/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/hi-IN/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/hi-IN/step_8.md b/hi-IN/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/hi-IN/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/it-IT/banner.png b/it-IT/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/it-IT/banner.png differ diff --git a/it-IT/code/code-project-example/main.py b/it-IT/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/it-IT/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/it-IT/code/code-project-example/project_config.yml b/it-IT/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/it-IT/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/it-IT/images/avery.png b/it-IT/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/it-IT/images/avery.png differ diff --git a/it-IT/images/backdrop_editor.png b/it-IT/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/it-IT/images/backdrop_editor.png differ diff --git a/it-IT/images/backdrop_menu_paint.png b/it-IT/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/it-IT/images/backdrop_menu_paint.png differ diff --git a/it-IT/images/banner.png b/it-IT/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/it-IT/images/banner.png differ diff --git a/it-IT/images/kabaddi.png b/it-IT/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/it-IT/images/kabaddi.png differ diff --git a/it-IT/images/opponent.png b/it-IT/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/it-IT/images/opponent.png differ diff --git a/it-IT/images/rename-opponent.png b/it-IT/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/it-IT/images/rename-opponent.png differ diff --git a/it-IT/images/rename-player.png b/it-IT/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/it-IT/images/rename-player.png differ diff --git a/it-IT/images/scratch-thumbnail.png b/it-IT/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/it-IT/images/scratch-thumbnail.png differ diff --git a/it-IT/images/sprite-choose.png b/it-IT/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/it-IT/images/sprite-choose.png differ diff --git a/it-IT/images/stage.png b/it-IT/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/it-IT/images/stage.png differ diff --git a/it-IT/images/variables.png b/it-IT/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/it-IT/images/variables.png differ diff --git a/it-IT/meta.yml b/it-IT/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/it-IT/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/it-IT/step_1.md b/it-IT/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/it-IT/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/it-IT/step_2.md b/it-IT/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/it-IT/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/it-IT/step_3.md b/it-IT/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/it-IT/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/it-IT/step_4.md b/it-IT/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/it-IT/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/it-IT/step_5.md b/it-IT/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/it-IT/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/it-IT/step_6.md b/it-IT/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/it-IT/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/it-IT/step_7.md b/it-IT/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/it-IT/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/it-IT/step_8.md b/it-IT/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/it-IT/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/ja-JP/banner.png b/ja-JP/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/ja-JP/banner.png differ diff --git a/ja-JP/code/code-project-example/main.py b/ja-JP/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/ja-JP/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/ja-JP/code/code-project-example/project_config.yml b/ja-JP/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/ja-JP/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/ja-JP/images/avery.png b/ja-JP/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/ja-JP/images/avery.png differ diff --git a/ja-JP/images/backdrop_editor.png b/ja-JP/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/ja-JP/images/backdrop_editor.png differ diff --git a/ja-JP/images/backdrop_menu_paint.png b/ja-JP/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/ja-JP/images/backdrop_menu_paint.png differ diff --git a/ja-JP/images/banner.png b/ja-JP/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/ja-JP/images/banner.png differ diff --git a/ja-JP/images/kabaddi.png b/ja-JP/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/ja-JP/images/kabaddi.png differ diff --git a/ja-JP/images/opponent.png b/ja-JP/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/ja-JP/images/opponent.png differ diff --git a/ja-JP/images/rename-opponent.png b/ja-JP/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/ja-JP/images/rename-opponent.png differ diff --git a/ja-JP/images/rename-player.png b/ja-JP/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/ja-JP/images/rename-player.png differ diff --git a/ja-JP/images/scratch-thumbnail.png b/ja-JP/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/ja-JP/images/scratch-thumbnail.png differ diff --git a/ja-JP/images/sprite-choose.png b/ja-JP/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/ja-JP/images/sprite-choose.png differ diff --git a/ja-JP/images/stage.png b/ja-JP/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/ja-JP/images/stage.png differ diff --git a/ja-JP/images/variables.png b/ja-JP/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/ja-JP/images/variables.png differ diff --git a/ja-JP/meta.yml b/ja-JP/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/ja-JP/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/ja-JP/step_1.md b/ja-JP/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/ja-JP/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/ja-JP/step_2.md b/ja-JP/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/ja-JP/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/ja-JP/step_3.md b/ja-JP/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/ja-JP/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/ja-JP/step_4.md b/ja-JP/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/ja-JP/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/ja-JP/step_5.md b/ja-JP/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/ja-JP/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/ja-JP/step_6.md b/ja-JP/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/ja-JP/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/ja-JP/step_7.md b/ja-JP/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/ja-JP/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/ja-JP/step_8.md b/ja-JP/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/ja-JP/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/nl-NL/banner.png b/nl-NL/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/nl-NL/banner.png differ diff --git a/nl-NL/code/code-project-example/main.py b/nl-NL/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/nl-NL/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/nl-NL/code/code-project-example/project_config.yml b/nl-NL/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/nl-NL/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/nl-NL/images/avery.png b/nl-NL/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/nl-NL/images/avery.png differ diff --git a/nl-NL/images/backdrop_editor.png b/nl-NL/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/nl-NL/images/backdrop_editor.png differ diff --git a/nl-NL/images/backdrop_menu_paint.png b/nl-NL/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/nl-NL/images/backdrop_menu_paint.png differ diff --git a/nl-NL/images/banner.png b/nl-NL/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/nl-NL/images/banner.png differ diff --git a/nl-NL/images/kabaddi.png b/nl-NL/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/nl-NL/images/kabaddi.png differ diff --git a/nl-NL/images/opponent.png b/nl-NL/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/nl-NL/images/opponent.png differ diff --git a/nl-NL/images/rename-opponent.png b/nl-NL/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/nl-NL/images/rename-opponent.png differ diff --git a/nl-NL/images/rename-player.png b/nl-NL/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/nl-NL/images/rename-player.png differ diff --git a/nl-NL/images/scratch-thumbnail.png b/nl-NL/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/nl-NL/images/scratch-thumbnail.png differ diff --git a/nl-NL/images/sprite-choose.png b/nl-NL/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/nl-NL/images/sprite-choose.png differ diff --git a/nl-NL/images/stage.png b/nl-NL/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/nl-NL/images/stage.png differ diff --git a/nl-NL/images/variables.png b/nl-NL/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/nl-NL/images/variables.png differ diff --git a/nl-NL/meta.yml b/nl-NL/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/nl-NL/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/nl-NL/step_1.md b/nl-NL/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/nl-NL/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/nl-NL/step_2.md b/nl-NL/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/nl-NL/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/nl-NL/step_3.md b/nl-NL/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/nl-NL/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/nl-NL/step_4.md b/nl-NL/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/nl-NL/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/nl-NL/step_5.md b/nl-NL/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/nl-NL/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/nl-NL/step_6.md b/nl-NL/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/nl-NL/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/nl-NL/step_7.md b/nl-NL/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/nl-NL/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/nl-NL/step_8.md b/nl-NL/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/nl-NL/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/pt-BR/banner.png b/pt-BR/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/pt-BR/banner.png differ diff --git a/pt-BR/code/code-project-example/main.py b/pt-BR/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/pt-BR/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/pt-BR/code/code-project-example/project_config.yml b/pt-BR/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/pt-BR/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/pt-BR/images/avery.png b/pt-BR/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/pt-BR/images/avery.png differ diff --git a/pt-BR/images/backdrop_editor.png b/pt-BR/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/pt-BR/images/backdrop_editor.png differ diff --git a/pt-BR/images/backdrop_menu_paint.png b/pt-BR/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/pt-BR/images/backdrop_menu_paint.png differ diff --git a/pt-BR/images/banner.png b/pt-BR/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/pt-BR/images/banner.png differ diff --git a/pt-BR/images/kabaddi.png b/pt-BR/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/pt-BR/images/kabaddi.png differ diff --git a/pt-BR/images/opponent.png b/pt-BR/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/pt-BR/images/opponent.png differ diff --git a/pt-BR/images/rename-opponent.png b/pt-BR/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/pt-BR/images/rename-opponent.png differ diff --git a/pt-BR/images/rename-player.png b/pt-BR/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/pt-BR/images/rename-player.png differ diff --git a/pt-BR/images/scratch-thumbnail.png b/pt-BR/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/pt-BR/images/scratch-thumbnail.png differ diff --git a/pt-BR/images/sprite-choose.png b/pt-BR/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/pt-BR/images/sprite-choose.png differ diff --git a/pt-BR/images/stage.png b/pt-BR/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/pt-BR/images/stage.png differ diff --git a/pt-BR/images/variables.png b/pt-BR/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/pt-BR/images/variables.png differ diff --git a/pt-BR/meta.yml b/pt-BR/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/pt-BR/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/pt-BR/step_1.md b/pt-BR/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/pt-BR/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/pt-BR/step_2.md b/pt-BR/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/pt-BR/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/pt-BR/step_3.md b/pt-BR/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/pt-BR/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/pt-BR/step_4.md b/pt-BR/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/pt-BR/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/pt-BR/step_5.md b/pt-BR/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/pt-BR/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/pt-BR/step_6.md b/pt-BR/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/pt-BR/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/pt-BR/step_7.md b/pt-BR/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/pt-BR/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/pt-BR/step_8.md b/pt-BR/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/pt-BR/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project! diff --git a/uk-UA/banner.png b/uk-UA/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/uk-UA/banner.png differ diff --git a/uk-UA/code/code-project-example/main.py b/uk-UA/code/code-project-example/main.py new file mode 100644 index 0000000..7dc46d6 --- /dev/null +++ b/uk-UA/code/code-project-example/main.py @@ -0,0 +1 @@ +print("Hello, world") diff --git a/uk-UA/code/code-project-example/project_config.yml b/uk-UA/code/code-project-example/project_config.yml new file mode 100644 index 0000000..e67d58a --- /dev/null +++ b/uk-UA/code/code-project-example/project_config.yml @@ -0,0 +1,4 @@ +name: "Code Project Example" +identifier: "code-project-example" +type: 'python' +build: false diff --git a/uk-UA/images/avery.png b/uk-UA/images/avery.png new file mode 100644 index 0000000..b4bc2d6 Binary files /dev/null and b/uk-UA/images/avery.png differ diff --git a/uk-UA/images/backdrop_editor.png b/uk-UA/images/backdrop_editor.png new file mode 100644 index 0000000..7525c9b Binary files /dev/null and b/uk-UA/images/backdrop_editor.png differ diff --git a/uk-UA/images/backdrop_menu_paint.png b/uk-UA/images/backdrop_menu_paint.png new file mode 100644 index 0000000..8c2280f Binary files /dev/null and b/uk-UA/images/backdrop_menu_paint.png differ diff --git a/uk-UA/images/banner.png b/uk-UA/images/banner.png new file mode 100644 index 0000000..382c5c7 Binary files /dev/null and b/uk-UA/images/banner.png differ diff --git a/uk-UA/images/kabaddi.png b/uk-UA/images/kabaddi.png new file mode 100644 index 0000000..f22fb03 Binary files /dev/null and b/uk-UA/images/kabaddi.png differ diff --git a/uk-UA/images/opponent.png b/uk-UA/images/opponent.png new file mode 100644 index 0000000..937141f Binary files /dev/null and b/uk-UA/images/opponent.png differ diff --git a/uk-UA/images/rename-opponent.png b/uk-UA/images/rename-opponent.png new file mode 100644 index 0000000..74d781d Binary files /dev/null and b/uk-UA/images/rename-opponent.png differ diff --git a/uk-UA/images/rename-player.png b/uk-UA/images/rename-player.png new file mode 100644 index 0000000..e8793e0 Binary files /dev/null and b/uk-UA/images/rename-player.png differ diff --git a/uk-UA/images/scratch-thumbnail.png b/uk-UA/images/scratch-thumbnail.png new file mode 100644 index 0000000..e3a7bda Binary files /dev/null and b/uk-UA/images/scratch-thumbnail.png differ diff --git a/uk-UA/images/sprite-choose.png b/uk-UA/images/sprite-choose.png new file mode 100644 index 0000000..ac20178 Binary files /dev/null and b/uk-UA/images/sprite-choose.png differ diff --git a/uk-UA/images/stage.png b/uk-UA/images/stage.png new file mode 100644 index 0000000..513dc38 Binary files /dev/null and b/uk-UA/images/stage.png differ diff --git a/uk-UA/images/variables.png b/uk-UA/images/variables.png new file mode 100644 index 0000000..b5dd954 Binary files /dev/null and b/uk-UA/images/variables.png differ diff --git a/uk-UA/meta.yml b/uk-UA/meta.yml new file mode 100644 index 0000000..3f0fae8 --- /dev/null +++ b/uk-UA/meta.yml @@ -0,0 +1,20 @@ +title: Kabaddi! +hero_image: images/banner.png +description: Make a game inspired by kabaddi, where the player must tag opponents and avoid being caught, while managing a countdown timer +version: 1 +listed: true +copyedit: true +last_tested: "2025-01-01" +steps: + - title: What you will make + - title: Set up the Stage + completion: engaged + - title: Set up the player and controls + - title: Add opponents + - title: Tagging and being caught + completion: internal + - title: Make the kabaddi timer + - title: Challenge + challenge: true + - title: What next? + completion: external diff --git a/uk-UA/step_1.md b/uk-UA/step_1.md new file mode 100644 index 0000000..e48eae7 --- /dev/null +++ b/uk-UA/step_1.md @@ -0,0 +1,24 @@ +## What you will make + +Make a game inspired by [kabaddi](https://en.wikipedia.org/wiki/Kabaddi), where the player must cross a line, tag opponents, and avoid being caught, while managing a countdown timer by repeatedly pressing the space bar. + +### Rules: + +- Use the arrow keys to tag opponents. +- Opponents will chase you, but cannot cross the green line. +- You can only touch one opponent at a time. If you touch more than one opponent at a time, they have caught you and you will lose a life. +- You must press the space bar **at least once every second** or you will lose a life. + +\--- print-only --- + +![The finished game.](images/kabaddi.png) + +\--- /print-only --- + +\--- no-print --- + +
+ +
+ +\--- /no-print --- diff --git a/uk-UA/step_2.md b/uk-UA/step_2.md new file mode 100644 index 0000000..4ced276 --- /dev/null +++ b/uk-UA/step_2.md @@ -0,0 +1,110 @@ +## Set up the Stage + +To set up the game, you will draw the green line and make all the variables you will need. + +\--- task --- + +First, paint the green line. This will set a safe zone for the player. + +![The 'Paint' option highlighted in the 'Choose a Backdrop' menu.](images/backdrop_menu_paint.png) + +In the **Backdrops** editor, draw a vertical green line across the canvas at around x = –100 (between the left edge and the centre). The line should have a thickness of 20 pixels. + +![The Backdrops editor with a green vertical line drawn across the canvas on the left-hand side.](images/backdrop_editor.png) + +\--- /task --- + +\--- task --- + +Create two variables, `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}. + +![The 'Variables' blocks menu with 'lives' and 'opponent tagged' ticked.](images/variables.png) + +These variables will control scoring, and they will be used to identify when the player has won or lost. + +\--- /task --- + +\--- task --- + +Write the game 'start' script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `start`, and add the `broadcast`{:class='block3events'} block to the bottom of your script: + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++broadcast (start v) +``` + +This is the message that you will use to start all the sprites in the game. + +\--- /task --- + +Next, add the counters for both `lives`{:class='block3variables'} and `opponent tagged`{:class='block3variables'}, to control winning and losing the game. + +\--- task --- + +Create two new `broadcast`{:class='block3events'} messages, `win` and `lose`. + +\--- /task --- + +\--- task --- + +Add this code to the bottom of your script: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +broadcast (start v) ++forever +if <(opponent tagged) = (7)> then // Tagging 7 opponents means the player wins + broadcast (win v) + wait (3) seconds +end ++end +``` + +\--- /task --- + +\--- task --- + +Add the code for running out of lives: + +```blocks3 +when green flag clicked +set [lives v] to (5) // The player has 5 lives at the start +set [opponent tagged v] to (0) +broadcast (start v) +forever +if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds +end ++if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds ++end +end +``` + +\--- /task --- + +In the next step, you will make the controls for the player. + +\--- save --- \ No newline at end of file diff --git a/uk-UA/step_3.md b/uk-UA/step_3.md new file mode 100644 index 0000000..68bd1ba --- /dev/null +++ b/uk-UA/step_3.md @@ -0,0 +1,99 @@ +## Set up the player and controls + +Add a player sprite and make it move around. + +\--- task --- + +Delete the **Sprite1** sprite — click on the **Delete** icon on the thumbnail: + +![The Scratch cat sprite thumbnail with the name Sprite1, with a 'Delete' icon.](images/scratch-thumbnail.png) + +\--- /task --- + +\--- task --- + +Use the **Choose a Sprite** menu to add a **player** sprite. Choose anything you like — in this example, we will use the **Avery Walking** sprite: + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Player`. + +![The sprite name set to 'Player' in the Sprite pane.](images/rename-player.png) + +![The Avery Walking sprite is now named Player.](images/avery.png) + +\--- /task --- + +\--- task --- + +Create the 'start' script for the player: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +``` + +This makes sure that the player begins in the correct position and scale. + +\--- /task --- + +\--- task --- + +Add arrow key movement: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds ++repeat until <(lives) = (0)> + if then // allows player to move up + change y by (10) + end + if then // allows player to move down + change y by (-10) + end + if then // allows player to move right + change x by (10) + end + if then // allows player to move left + change x by (-10) + end ++end +``` + +\--- /task --- + +\--- task --- + +Add code to stop the game if the player wins or loses: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (lose v) +say [TRY AGAIN!] for (2) seconds +stop [all v] + +when I receive (win v) +say [YOU WIN!] for (2) seconds +stop [all v] +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure you can control the **Player** sprite. + +\--- /task --- + +In the next step, you will make opponents who will chase the player! + +\--- save --- \ No newline at end of file diff --git a/uk-UA/step_4.md b/uk-UA/step_4.md new file mode 100644 index 0000000..737557e --- /dev/null +++ b/uk-UA/step_4.md @@ -0,0 +1,97 @@ +## Add opponents + +Make opponents appear and chase the player. + +\--- task --- + +Add an **opponent** sprite. In this example, we will use the **Characters 1** sprite (with the costume **character1-e**): + +![The 'Choose a Sprite' icon highlighted.](images/sprite-choose.png) + +Rename the sprite `Opponent`. + +![The sprite name set to 'Opponent' in the Sprite pane.](images/rename-opponent.png) + +![The Characters 1 sprite is now named Opponent.](images/opponent.png) + +\--- /task --- + +\--- task --- + +Add a setup script for the **Opponent** sprite: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive [start v] +set size to (25)% +set rotation style [left-right v] +hide // This prepares the sprite to clone itself without showing it +repeat (7) + create clone of [myself v] +end +``` + +\--- /task --- + +\--- task --- + +Give each clone a random appearance and position: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player! + +\--- /task --- + +\--- task --- + +Now, add this new code **inside** your `repeat until`{:class="block3control"} `lives`{:class="block3variables"} `=`{:class="block3operators"} `0` loop, so that if the opponents touch the green line, they are moved away: + +```blocks3 +when I start as a clone +switch costume to (pick random (1) to (13)) +go to x:(pick random (-100) to (240)) y:(pick random (-180) to (180)) +show +repeat until <(lives) = (0)> + point towards (Player v) // Each clone will chase the player + turn right (pick random (-70) to (70)) degrees + move (2) steps + if on edge, bounce ++ if then + change x by (100) + change y by (pick random (-180) to (180) + end +end +delete this clone +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and watch the opponents rush towards the player, but bounce off the green line. + +\--- /task --- + +In the next step, you will make the player be able to tag opponents, and make the opponents be able to catch the player. + +\--- save --- diff --git a/uk-UA/step_5.md b/uk-UA/step_5.md new file mode 100644 index 0000000..0f208ab --- /dev/null +++ b/uk-UA/step_5.md @@ -0,0 +1,170 @@ +## Tagging and being caught + +Make the tagging and scoring work. + +### Tagging opponents + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag opponent`. This will be used to keep track of how many opponents the player tags. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, so that it identifies when the player tags an opponent: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end ++ if then + broadcast (tag opponent v) ++ end +end +``` + +\--- /task --- + +\--- task --- + +On the **Opponent** sprite, add this new code to remove opponents who are tagged: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I receive (tag opponent v) +if then + delete this clone +end +``` + +\--- /task --- + +\--- task --- + +The Stage will handle the scoring in the game. Add these blocks to the **Stage**: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (tag opponent v) +change [opponent tagged v] by (1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure the opponent tagging works: the score should change and each clone should disappear when touched by the player. + +\--- /task --- + +### Being caught + +In kabaddi, the player must tag opponents, but not get caught themselves. In this game, if more than one opponent is touching the player, the player has been caught. You need to make a way to identify if more than one opponent is touching the player. + +\--- task --- + +On the **Stage**, make a new `variable`{:class='block3variables'} called `touching`. + +\--- /task --- + +\--- task --- + +Add this code to the **Opponent** sprite, so that the game checks if more than one opponent is touching the player: + +![The Opponent sprite.](images/opponent.png) + +```blocks3 +when I start as a clone +repeat until <(lives) = (0)> + if then + change [touching v] by (1) + wait until > + change [touching v] by (-1) + end +end +``` + +\--- /task --- + +\--- task --- + +Create a new `broadcast`{:class='block3events'} with the message `tag player`. + +\--- /task --- + +\--- task --- + +Add this code to the 'start' script on the **Stage**, to make sure that the `touching`{:class='block3variables'} variable is set to `0` when the game starts, and that the game identifies when more than one opponent is touching the player (`touching`{:class='block3variables'} `>`{:class='block3operators'} `1`). + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) ++set [touching v] to (0) +broadcast (start v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end ++ if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds ++ end +end +``` + +\--- /task --- + +If more than one opponent touches the player, the player has been 'tagged' and needs to lose a life and go back across the green line. + +\--- task --- + +Add this code to the **Player** sprite, so that the player moves back to the starting position and loses a life if they are tagged: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive (tag player v) +go to x:(-160) y:(0) +change [lives v] by (-1) +``` + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the lives counter works and the player moves back across the green line when they are caught by more than one opponent. + +\--- /task --- + +In the next step, you will make the player 'say kabaddi' using a key press. + +\--- save --- + diff --git a/uk-UA/step_6.md b/uk-UA/step_6.md new file mode 100644 index 0000000..223ec75 --- /dev/null +++ b/uk-UA/step_6.md @@ -0,0 +1,107 @@ +## Make the kabaddi timer + +In kabaddi, the player has to keep repeating the word 'kabaddi' to show that they are not taking another breath. To simulate that, the player will need to press the space bar at least every second, or they will lose a life. + +\--- task --- + +Create a new `variable`{:class='block3variables'} called `kabaddi`. You will use this as a timer to make sure the player presses the 'kabaddi' button (the space bar) regularly, just like having to repeat "Kabaddi!" while you play. + +\--- /task --- + +\--- task --- + +Add this code to the **Player** sprite, to simulate saying "Kabaddi!" by pressing Space: + +![The Player sprite.](images/avery.png) + +```blocks3 +when I receive [start v] +set size to (25)% +go to x:(-160) y:(0) +wait (1) seconds +repeat until <(lives) = (0)> + if then + change y by (10) + end + if then + change y by (-10) + end + if then + change x by (10) + end + if then + change x by (-10) + end + if then + broadcast [tag opponent v] + end ++ if then + set [kabaddi v] to (1) + end +end +``` + +\--- /task --- + +\--- task --- + +On the **Stage**, add a new `broadcast`{:class='block3events'} with the message `kabbadi` to your 'start' script, so that the kabaddi timer (which you will set up next) starts running when the game starts: + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when green flag clicked +set [lives v] to (5) +set [opponent tagged v] to (0) +set [touching v] to (0) +broadcast (start v) ++broadcast (kabaddi v) +forever + if <(opponent tagged) = (7)> then + broadcast (win v) + wait (3) seconds + end + if <(lives) = (0)> then + broadcast (lose v) + wait (3) seconds + end + if <(touching) > (1)> then + broadcast (tag player v) + set [touching v] to (0) + wait (1) seconds + end +end +``` + +\--- /task --- + +\--- task --- + +Add this new code to the **Stage**, to make a one-second timer that keeps track of the player 'saying kabaddi': + +![The Stage with a vertical green line across the centre.](images/stage.png) + +```blocks3 +when I receive (kabaddi v) +set [kabaddi v] to (1) +repeat until <(kabaddi) < (0)> + wait (0.1) seconds + change [kabaddi v] by (-0.1) +end +broadcast (tag player v) +broadcast (kabaddi v) +``` + +Players must press the space bar regularly (at least every second) to reset their timer, or they will be 'tagged' and lose a life. The timer will then start again when the `broadcast`{:class='block3events'} is sent. + +\--- /task --- + +\--- task --- + +**Test your code.** Click on the green flag and make sure that the kabaddi timer works and that it resets when you press the space bar. + +\--- /task --- + +``` + +``` diff --git a/uk-UA/step_7.md b/uk-UA/step_7.md new file mode 100644 index 0000000..72fd5fa --- /dev/null +++ b/uk-UA/step_7.md @@ -0,0 +1,34 @@ +## Challenge + +Make your project even better! + +\--- task --- + +Add effect `Sounds`{:class='block3sound'} for: + +- Winning +- Losing +- Saying "Kabaddi!" when the space bar is pressed (for example, you could record yourself saying it!) +- Tagging an opponent +- The player being tagged +- The game starting + +\--- /task --- + +\--- task --- + +Add a restart loop, so that the game restarts after a certain amount of time and the player does not need to click on the green flag again. + +\--- /task --- + +\--- task --- + +Add `Looks`{:class='block3looks'} blocks to create a walking animation for the **Player** sprite. + +\--- /task --- + +\--- task --- + +Allow the user to change how fast the clones move to create a game 'difficulty level'. + +\--- /task --- diff --git a/uk-UA/step_8.md b/uk-UA/step_8.md new file mode 100644 index 0000000..99795d4 --- /dev/null +++ b/uk-UA/step_8.md @@ -0,0 +1,3 @@ +## What next? + +Try another [Scratch](https://projects.raspberrypi.org/en/projects?software%5B%5D=scratch){:target="_blank"} project!