Home
Project Folders
Teacher Resources
Student Resources
En ESPAÑOL
How Do I?
Vocabulary
MWForum
Site Map
Search
Our Team

bouncing off walls 1 2 3
Bouncing Off Walls 2
Download
6 KB


Goal:   Fine tune the speed of the car.


Screenshot


Vocabulary:   / (division sign)

Code
Shapes
Project Map

code


Notes

  1. Create a slider named speed.   Set the minimum to 0 and the maximum to 10.

  2. Instead of writing fd 1 or fd 2 or fd 5 we can write fd speed and the turtle will move forward the number (of turtle steps) on the speed slider.   But sometimes even a speed of 1 is too fast.   How can we slow down the turtle?

    When we write
    fd speed / 2
    we are telling the turtle to divide the number on the slider by 2.
    Fd speed / 2 means that if you set the slider to 1, the turtle will move forward 1/2.   If you set the slider to 2, it will move forward 2/2 (which is 1).   If you set the slider to 10, it will move forward 10 / 2 (which is 5).   So fd 5 is the fastest that this turtle will go.




What If?
What happens if you change the numbers on the speed slider?
What happens if you try a maximum of 20 or 50 or 100 instead of 10?


Challenge
What happens if you divide the slider speed by a different number?


On Your Own - Project Ideas
Instead of dividing the slider speed by a whole number, try multiplying the slider speed by a decimal number.   (Use the * symbol to multiply.)





© copyright 2001 - 2016  OpenWorld Learning.   All rights reserved.