'Called when Mario is in a JUMP state.'

def jumping(self, keys, fire_group):

    self.allow_jump = False
    self.frame_index = 4
    self.gravity = c.JUMP_GRAVITY
    self.y_vel += self.gravity
    self.check_to_allow_fireball(keys)
    if ((self.y_vel >= 0) and (self.y_vel < self.max_y_vel)):
        self.gravity = c.GRAVITY
        self.state = c.FALL
    if keys[tools.keybinding['left']]:
        if (self.x_vel > (self.max_x_vel * (-1))):
            self.x_vel -= self.x_accel
    elif keys[tools.keybinding['right']]:
        if (self.x_vel < self.max_x_vel):
            self.x_vel += self.x_accel
    if (not keys[tools.keybinding['jump']]):
        self.gravity = c.GRAVITY
        self.state = c.FALL
    if keys[tools.keybinding['action']]:
        if (self.fire and self.allow_fireball):
            self.shoot_fireball(fire_group)
