scratch askiseis

Upload: amalia-charisi

Post on 07-Apr-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Scratch Askiseis

    1/28

    Step 1: Choosing Your Sprite

    A Sprite is an character or object in your game. Sprites can move and beactive or be props that stay still. We will choose a Sprite character that willmove about your screen.

    1. Open Scratcha. Go to the folder where you copied "Scratch."

    b. Double click on the Scratch icon.

    2. You will see the opening screen.

    3. Click on the "Costumes" Tab

  • 8/6/2019 Scratch Askiseis

    2/28

    4. Click "Import"

    5. Select a Folder (Animals, People, Things)

  • 8/6/2019 Scratch Askiseis

    3/28

    6. Choose a Sprite! (Double Click)

    Step 2: Making Your Sprite Move in 4 directions (Right, Left, Up,Down)

    Sprites can not do anything by themselves. A Sprite's action comes fromthe scripts in the script window. These scripts are the instructions for exactly what the sprite will do. You drag these instructions from the Tile

    pane into the "Scripts" pane. These tiles then fit together like a puzzle tocreate the insructions.

    7. Click on the "Scripts" Tab

    8. You want your Sprite to move to the right. Click the "Control" Button

  • 8/6/2019 Scratch Askiseis

    4/28

    9. Left Click and hold "When 'space' pressed" command and drag to theScripts window.

    10. Click on the word "space" and select "right arrow." (We will makeSprite move right)

  • 8/6/2019 Scratch Askiseis

    5/28

    11. Click on the "Motion" button and drag "point in direction 90" over to theScripts window.

    12. Connect the "point in direction" tile to the "When 'right arrow' pressed"command.

  • 8/6/2019 Scratch Askiseis

    6/28

    13. Click the "Move 10 steps" tile and drag over to the Scripts window.

    14. Connect "Move 10 steps" to the "point in direction" tile.

    15. Press the right arrow on the computer and watch your sprite move to the

  • 8/6/2019 Scratch Askiseis

    7/28

    right.

    16. Making your sprite go left: Drag the "When 'space' pressed" tile to thescripts window.

    17. Drag "point in direction 90" over to the Scripts window. Connect to the"When 'space' pressed." tile.

  • 8/6/2019 Scratch Askiseis

    8/28

    18. Change the 'space' to 'left arrow.' Change the '90' to '-90' to make thesprite face left:

    19. Drag the "Move 10 steps" tile to the scripts window and connect to the'left arrow' script.

  • 8/6/2019 Scratch Askiseis

    9/28

    20. Now your left arrow will work! Click the "just flip left-right" icon tomake your sprite face in the correct directions.

  • 8/6/2019 Scratch Askiseis

    10/28

    21. Making your sprite move down: Drag and connect the following tiles:a. "When 'space' pressed

    b. "point in direction '90'"c. "move 10 steps"

    22. Set the direction to down:a. Change 'space' to 'down arrow'

    b. Change '90' to '180'

  • 8/6/2019 Scratch Askiseis

    11/28

    23. Your down arrow should work!

    24. Make your sprite move up: Drag and connect the following tiles:a. "When 'space' pressed

    b. "point in direction '90'"c. "move 10 steps"

  • 8/6/2019 Scratch Askiseis

    12/28

  • 8/6/2019 Scratch Askiseis

    13/28

    26. Now your Sprite should be able to move in all 4 directions! Test your program by moving your Sprite about the screen.27. Rename your Sprite as "Eater."28. Save your work! Click "Save" and name your file.

    Scratch Exercise 2: Sense the World -

    Using Conditional Statements

    Step 1: Draw a Maze

    We need to create a maze to act as a barrier for our main character. Wewill create another sprite that acts as the maze.

  • 8/6/2019 Scratch Askiseis

    14/28

    1 . Click on the "Paint New Sprite" icon

    2. Use the "zoom out tool" on the drawing program to zoom all the way

    out.

    3. Click the "Rectangle Outline Tool" and draw a border around the world.

  • 8/6/2019 Scratch Askiseis

    15/28

    4. Use the "Rectangle Filled Tool" to draw some barriers to create a maze.

    5. Click "OK" to finish your drawing.

    6. Change the name of this new sprite to "Maze"

    Step 2: Bounce off the Maze

  • 8/6/2019 Scratch Askiseis

    16/28

    1 . Go back to the "Eater" sprite's scripts.

    2. Drag a "When Green Flag Clicked" and a " Forever if" into the scripts field.

    3. Drag a "touching" hexagon from the sensing menu. Select "Maze" fromdrop down list.

  • 8/6/2019 Scratch Askiseis

    17/28

    4. Add a "turn 1 5 degrees" and change value to " 180 ." Add a "Move 10 steps" block.

  • 8/6/2019 Scratch Askiseis

    18/28

    5. Test your program. Click the green flag and use the arrow keys to direct

    your sprite into the wall. It should bounce and turn around.

    Scratch Exercise 3: Something to Eat.Conditionals, Variables, Hiding, and

    Sound.

    Step 1: Create the food!

    1 . Select a New Sprite from file. I used a tennis ball, but you can select ordraw anything.

    2. Use the "shrink sprite tool" to make the food smaller in relation to therest of the world.

  • 8/6/2019 Scratch Askiseis

    19/28

    3. Rename the sprite. (I chose "Ball.")

    Step 2: Create the scripts for score and hiding.

    1 . Click on "Variables" and "Make a Variable" and name it "Score." Click"Ok."

  • 8/6/2019 Scratch Askiseis

    20/28

    2. Drag a "When Green Flag Clicked" and a "Forever If" into the Ball's

    scripts field.

  • 8/6/2019 Scratch Askiseis

    21/28

    3. Add the following scripts:

    a. Set "Score to 0 " between the Green Flag and the Fo rever if.b. "Change Score by 1 " inside the "forever if."c. Blue Hexagon "touching 'Eater'" inside the forever if.

  • 8/6/2019 Scratch Askiseis

    22/28

    4. Add a "show" and "hide" to the script. Put the "show" underneath the"when Green Flag Clicked" and the "hide" inside the forever scr ipt.

    5. Check your program. Click the green flag and run your Eater over thefood. It should hide and change your score by 1 . Click the Green Flagagain, the score should set to zero and the food should show again.

    Step 3: Add a Sound when the Eater touches the ball.

    1 . Make sure you are on the Eater sprite. Click the "Sounds" tab.

  • 8/6/2019 Scratch Askiseis

    23/28

    2. Select "Import Sound" and select a sound from the folder list.

  • 8/6/2019 Scratch Askiseis

    24/28

  • 8/6/2019 Scratch Askiseis

    25/28

    3. You can test your sound by clicking the blue play triangle under the

    sound name.

    4. Click on the Scripts Tab. Drag a purple "play sound and wait" block intothe Ball's script.

    5. Click the Green Flag and test your program. When the Eater touches theBall you should hear a sound and the score should increase by 1 .

    Step 4: Copy objects.

    1 . Once you are satisfied with the Ball sprite and its scripts, click the

    "Stamp" tool and then click on the sprite you wish to copy. Use the"Stamp" tool to copy your Ball sprite.

  • 8/6/2019 Scratch Askiseis

    26/28

    2. Copy and arrange the ball sprites around the maze.

  • 8/6/2019 Scratch Askiseis

    27/28

    Step 5: Add background music.

    1 . You may add background music to your game. Scratch will play any .mp3or .wav files.

    2. Click on the stage icon.

    3. Click on Sounds and import a sound like Step 3.

    4. Drag a "When Green Flag Clicked" into the the Scr ipts pane.

    5. Drag a "forever" and a "play sound and wait" block and arrange like

    below.

  • 8/6/2019 Scratch Askiseis

    28/28

    6. Click the green flag and test your game.