90 likes | 313 Views
MMoM – Lesson 6. Things we have learnt already. Canvas Program Area Command Area Sprites Buttons Variables Setting values for variables when buttons are clicked. New learnings. Get rocket to move with earth Launch the rocket Control the rocket. Rocket - Go with Earth.
E N D
Things we have learnt already • Canvas • Program Area • Command Area • Sprites • Buttons • Variables • Setting values for variables when buttons are clicked.
New learnings • Get rocket to move with earth • Launch the rocket • Control the rocket
Rocket - Go with Earth • Create a rocket sprite • For the rocket to rotate with Earth • Forever • Goto Earth
Launch Button • Create a new variable called launch • Now to set values to this variable, create a button called launch. • When the launch button is clicked • Set value of launch variable to “yes” • Remember for the variable run we used two buttons continue and pause to set the values for the variable run • To simulate the same we can use the green flag to set launch to “no”
Basic Rocket Motion • If launch = yes • Go to Saturn • Else • Got to Earth
Advanced Rocket Motion I • What was wrong with the basic launch • The rocket was too fast • We need some speed to control the rocket • Add a variable speed • Just for the spaceship sprite • Turn it into a slider • Set min and max values for it
Advanced Rocket Motion II • Program rocket with speed • Point towards Saturn • Move “speed” steps • Introduce the sensing commands • If touching Saturn • Go to Saturn
Next class • Advanced controls • Stop on hitting the sun • Score board