

Other common animation methods apply a stop motion technique to two- and three-dimensional objects like paper cutouts, puppets, or clay figures.Ī cartoon is an animated film, usually a short film, featuring an exaggerated visual style. Computer animation can be very detailed 3D animation, while 2D computer animation (which may have the look of traditional animation) can be used for stylistic reasons, low bandwidth, or faster real-time renderings. Today, many animations are made with computer-generated imagery (CGI). In traditional animation, images are drawn or painted by hand on transparent celluloid sheets to be photographed and exhibited on film. In the Create Event of the oPlayer object, let's define a couple of new variables.This animation moves at 10 frames per second.Īnimation is a method by which still figures are manipulated to appear as moving images. The easiest way to do this (without changing out basic movement code) is to change our aSpeed variable according to whether we are in the air or on the ground. You can take away in-air control entirely or allow for precise in-air control. Given our current setup, it's also really easy to adjust the amount of horizontal control the player has in the air. Try adjusting the value that ySpeed is multiplied by to see how this changes the feeling of the jump. If all of that checks out, then your ySpeed is divided in half. Next, we check to see if you are NOT holding the jump button (you just tapped it and let go). First, we check to see if onGround is false (you are in the air) and your ySpeed is less than zero (you are traveling up). When you let go of the jump button, your ySpeed is cut in half and your jump is cut short. Below the code we just added in the normal_state script, add the following lines.Ĭopy code Copied to clipboard. Tapping the jump button results in a short hop, while holding the button results in a full jump.

This means that you jump higher the longer you hold the jump button.

This may not be exactly what you want for your own game you may prefer to have a variable jump height. You may have noticed that jumping is always the same height, no matter how long you hold the jump button. This is our very scientific application of gravity. As long as our character is in the air, as indicated by onGround=false, we cause gravity to affect his vertical velocity by adding gSpeed to ySpeed. This is where our gSpeed, gravity speed, is being applied to the character. Before adjusting either of those values, though, open the code in the Begin Step event of the oPlayer object. These are all easy things to tweak by adjusting our gSpeed and jPower.

Run the game and check out your new jump! How does it feel? Too slow? Too fast? Does your character jump too high? Or maybe not high enough? No problem.
