override public function update():void
{
/* Walking and Jumping */
if (collide("ground", x, y + 1) || collide("ground2", x, y + 1) || collide("ground3", x, y + 1))
{
ySpeed = 0;
//moveBy(xSpeed, ySpeed, solidTypes, true);
if (Input.check("jump"))
{
if (facingForward) beagleSprite.play("jump_right");
else beagleSprite.play("jump_left");
ySpeed -= jumpPower;
}
if (Input.check("left"))
{
x -= jumpPower * .2;
facingForward = false;
}
if (Input.check("right"))
{
x += jumpPower * .2;
facingForward = true;
}
}
else if (collide("vehicle", x, y))
{
ySpeed = 0;
if (Input.check("jump"))
{
if (facingForward) beagleSprite.play("jump_right");
else beagleSprite.play("jump_left");
ySpeed-= .8 * jumpPower;
}
}
else ySpeed += gravity;
moveBy(xSpeed, ySpeed, solidTypes, true);
y += FP.elapsed * ySpeed;
FP.clampInRect(this, 0 + originX, 0 + originY, 640 - width, 460 - hei
ght);
I have 3 different grounds because I’m attempting to have it so that if a certain UPkey is pressed, the player will instantaneously appear on the upper level ground each time, with the Downkey making the player go down a level. And on each different ground level, the entity is still able to jump over obstacles with the SPACE key but still retain it’s current level. Any clue as to how to achieve this? Any help on that would be heavily appreciaite, I barely know what i’m doing lol