Project 95: Cannon Physics

4. Setup the Cannon Ball Launch Controls

We want the Cannon Ball to launch when the mouse is clicked and return to the cannon and hide when the mouse isn't clicked. Take advantage of the Looks Tab and conditional statements in the Control Tab
Starting point file for this challenge

Your goal

Steps

1. Switch to the Cannon Ball Sprite and Add Code to Hide it.

Let's grab a "when green flag clicked" and "hide" block from the purple Looks tab.  Connect them and test the green flag now. Finally wrap the hide in a "forever" loop. Think about when we want the Cannon Ball to show up in the simulation.

2. Make the Cannon Ball Show when a condition happens

Add a "if ____then  _____ else _____" block from the control tab to the forever loop, then add a "show" block  to the if side, and move the "hide" block from earlier inside the else side.  

3. Add a Launch Condition and a Loop for the Movement.

Use the "mouse down" block from the Sensing tab as our Launch Condition,  we should also add a "repeat until" loop below the "show" block to move our Cannon Ball through the launch.