function PMove() {
player.collide(FGroup);
var direction = (keyDown("right") || keyDown("d")) - (keyDown("left") || keyDown("a"));
if (direction !== 0) {
player.x += speed * direction;
player.mirrorX(direction);
player.setAnimation("walk");
} else {
player.setAnimation("still");
}
if ((keyDown("up") || keyDown("space") || keyDown("w")) && player.velocityY === 0) {
player.velocityY -= 8;
}
}
here, I don't feel like explaining right now maybe someone else will before i do, just did a few shorthand things and i think i managed to make it look nice