jueves, 15 de abril de 2021

Scratch Prácticas - Coding in the Elementary Grades

 Scratch Prácticas  - Coding in the Elementary Grades

https://sites.google.com/a/tdsb.on.ca/coding-in-the-elementary-grades/tips-tricks/buttons



Buttons & Key Pressed

A Simple Button

Embed gadget

Any sprite can behave like a button. Simply use the event block, "when this sprite is clicked".
When the sprite is clicked it switches the backdrop scene. It is also important to reset to the initial backdrop when the project is started again (when green flag is clicked)


Advanced Buttons

Embed gadget

You can use buttons with broadcast commands to signal other sprites for some action.


These blocks of code are for an arrow button. It does different things based on the current backdrop (name) that is loaded.
 
These blocks of code show and hide the arrow based on the scene it is in, signaled by the broadcast.


On Key Pressed

Embed gadget

You can use keyboard keys as events that can signal code to run.
These blocks respond when any of the directional buttons are pressed on the keyboard. When a directional button is pressed, it points the sprite in the corresponding direction and moves the sprite 10 steps forward.


Learning Task 1

Embed gadget

For this task, you will switch the backdrop when a button is pressed.
  1. Open the Scratch Project: 
    https://scratch.mit.edu/projects/103521636/
  2. Click on "Remix".
  3. Edit the button sprite so that it reads "start".

  4. Code the (start) button to switch to the "soccer" backdrop when it is clicked.
  5. Code the initial "circles" backdrop to show up when the project is started (when the green flag is clicked).


Learning Task 2

Embed gadget

For this task, you will animate the beetle sprite to move around the screen when the user pressed one of the direction buttons (i.e., up, down, left and right)
  1. Open the Scratch Project: 
    https://scratch.mit.edu/projects/103526676/
  2. Click on "Remix".
  3. Code the beetle sprite to move in all 4 directions based on the up, down, left and right arrows.


Learning Task 3

Embed gadget

For this task, you will switch (backdrop) scenes based on the current (backdrop) scene and the arrow sprite that is pressed.

Part A
  1. Open the Scratch Project: 
    https://scratch.mit.edu/projects/103524435/
  2. Click on "Remix".
  3. Code the right arrow to load the basketball backdrop when it is clicked
  4. Code the left arrow to load the playground backdrop when it is clicked
Part B
  1. Code the right arrow and left arrow to change behaviour based on the backdrop it is currently on using a decision statement that checks for the current backdrop name.
  • When left arrow clicked and if backdrop name is brick, go to playground backdrop
  • When left arrow clicked and if backdrop name is basketball, go to brick backdrop
  • When right arrow clicked and if backdrop name is brick, go to basketball backdrop
  • When right arrow clicked and if backdrop name is playground, go to brick backdrop
Part C
  1. Code the arrows to hide and show depending on the scene (i.e., brick backdrop show both right and left arrows, basketball backdrop only shows left arrow, and playground backdrop only shows right arrow.)
  2. Code the sprite character to say different things based on the scene it is in.



No hay comentarios:

Publicar un comentario