Use the mouse to rotate the cannon and click to fire. Press space to change the power (how far the cannonballs go)
This uses variables to note where the cannonballs WOULD be if they weren't constrained to the stage. This allows the cannonballs to go higher than they normally could and still act normally. A ball off the top of the screen will be indicated by a green arrow.