Declare a varible below to use with the vertical motion of the bee. This variable's intial value should not produce vertical motion. The jump should only occur when the up arrow is pressed.
provide the instructions to move the bee. Keep in mind that the motion could entail jumping, if the arrow key is pressed.
// example: // one instruction should move the bee horizontally. // another instruction should move the bee vertically using the variable you declared above, such as: // bee.y += yourvariable; // modify yourvariable to simulate gravity using the variable, gravity. // Eg. yourvariable += gravity;
Change two variable values in response to the up arrow. This should create the jumping motion.
// example: // yourvariable = somevalue; // Also, change the value of the variable, gravity.