Break the Targets 1. Start a New Project. a. Delete only When Run block, leaving the Repeat and Move blocks. 2. Drag in the When Object Clicked block – “There are other ways that we can change how our objects move around the screen. For example, if we use this When Object Clicked block, then our code will only execute when we click on our object. a. Connect the When Object Clicked block to the default code b. Hit Play and Demonstrate how the block works 3. Delete the Repeat and Move blocks a. Attach a Move to the X: __ Y: __ block onto the When Object Clicked block. 4. PROGRESS CHECK a. “Take a minute and make sure that your screen matches mine, and then raise your hand in NewRow when you’re ready to move on.” 5. Introduce Coordinate Planes – This introduction should be very brief. a. “If we want to put our object in a very specific place, or have it move in a specific direction, we can do that by playing with these Move blocks.” b. Click on the Eyeball Icon to Hide the EntryBot graphic c. Expand the Action Zone and Click on the Grid Symbol i. Show the students the X and Y values at the bottom of the action area, demonstrate how the values change depending on where your mouse is.
ii. Point out the numbers on the grid. Then use the mouse to show them: a. (0,0) b. (-220, 0) & (220, 0) c. (0, 100) & (0, -100) iii. “If you use an X value larger than 240, or a Y value of 135 (or -240 and -135), your object won’t show up on the screen!” 6. Testing Coordinate Plane – Have the students move their object to any corner of the screen, and then Run their code. If the coordinates are set to (0,0), the object should snap to the middle of the screen. 7. Introduce the Random Number calculate block – “Sometimes, we want object to move around in a less controlled way, you can use the Random Number block. With it, you can set your code to generate a random number within the ranges you type in. a. “Plug the Random Number block into the Y value. Set the number range from -120 to 120. Now, get your code to match mine, then, run your code and see how your object reacts!” 8. Put a Random Number block into the X Value a. “Plug the Random Number block into the X value. Set the number range for this one from -220 to 220. Get your code to match mine, then, run your code and see how your object reacts!” GAME COMPLETE!
Search
Read the Text Version
- 1 - 2
Pages: