Cannon Ball Process

Here is a break down of the steps/functions/features you’ll need to create for you cannon ball ballistics simulator.

  • Create your Cannon and Cannon Ball sprites.
  • Create a “Gravity” Variable and set it to a positive value. (You’ll adjust this value later.)
  • Map out all the user controls (what are they going to press or click) for:
    • turning the cannon
    • raising and lowering the starting velocity
    • firing the cannon
    • resetting the simulation.
  • Create controls for your Cannon’s direction.
    • Built in a limit to the rotation of the Cannon’s direction with conditional statements using the ‘direction’ variable in the ‘Motion’ section
    • Create a ‘Angle’ variable and update it with cannon’s direction every time it is changed.
  • Create a power meter to display to starting velocity of the cannon ball when it is fired.
    • Create a ‘Velocity’ variable.
    • Create user controls that allow the user to update the Velocity variable.
    • Draw a Power meter that will update every time you adjust the Velocity variable.
  • Create a “ResetBall” command for the Cannon Ball that will return it to it’s starting position.
  • Create a “ResetCannon” command for the Cannon that will return it to it’s starting position.
  • Create a “CalculateVx” and a”CalculateVy” reporter blocks that take the Velocity and Angle as inputs and returns the Vx and Vy. Use the Sin and Cosin formulas we discussed in class.
  • Create a “MoveBall” command block with inputs for Vx and Vy.
  • Create a “UpdateVy” command block that subtracts gravity from the current value of Vy
Advertisements

#projects