so, I'm making a game lab thing and for some reason, the code has STOPPED WORKING BEYOND THE NORMAL GLITCH THING

it says that it's working but it really isn't

the drawSprites(); command is broken or something plz help!

also here is the code as of this message:

var player = createSprite(200, 300);
player.setAnimation("player_idle");
var ground = createGroup();
ground.add(createSprite(200,50));
ground.setAnimationEach("ground_grass_1");
var END = createGroup();
ground.setScaleEach(0.4);
drawSprites();
function draw() {
background("white");
move();
}
function move() {
if (keyDown("right")) {
player.x = player.x+2;
player.setAnimation("player_walk");
player.mirrorX(+1);
} else if ((keyDown("left"))) {
player.x = player.x-1;
player.setAnimation("player_walk");
player.mirrorX(-1);
} else {
player.setAnimation("player_idle");
}
if (keyDown("up")){
player.y = player.y + 3 ;
if (player.isTouching(ground)) {
player.y = player.y - 10;
player.velocityY = -20 ;
} else {
player.y = player.y - 3 ;
}
}
}
function draw() {
player.collide(ground);
while ((player.isTouching(ground))) {
player.velocityY = 0 ;
player.y = player. y - 0.1 ;
}
}
!<

    Nvm fixed it! (code was broken bcause there were 2 draw functions)

    Zeldaria
    an interesting thing that is really basic but most people don't know about:

    you can just use drawSprite(sprite) if you only want to draw one sprite, It's easier than using the whole 'visible' thing If you just want to draw certain sprites in a certain scene

    CDO will give you a yellow triangle but it doesn't matter because it still works

    also for some reason the y is broken
    it won't let me place the player on the 'ground' group thing

    It won't let me move the player sprite past (code-wise, not visual wise) y 350 without it breaking and putting it at like Y 418 or something

    AND IT JUST STAYS AT Y 300 WHEN I TEST IT UGH

    what is going on there? He do be flying tho. You need to bring velocity into effect. he keeps going up. So using velocity and making it go up and then go down in an arch like way should work. hold on let me find my code for jumping right quick

    giggles it is hilarious to watch him fly out of sight

    soon Ima make the player look better but for now I need to work on the coding portion

    I gotta get my black vs red code. hold on. Also what type of game are you doing anyway?

    Zeldaria
    ok so I do agree with internecion about the velocity.

    basically, you have a constant
    player.velocityY += 0.1(or some other number);
    and then
    if(player.isTouching(ground)&&keyDown('up')){
    player.velocityY = -5(or some other negative number);
    }

    nice a zeldaria can you hold the fort. I will expain everything I promise

    thank you. just hear me out after all of this. you have been already. i am so greatful for that

    But um how do I fix the LOCATION bug?!

    If I could get the player to touch the ground well then I COULD DEBUG THE JUMP BETTER IF IT NEEDED DEBUGGING!
    I appreciate you guys trying to help me with the jump bug thing but that wasn't what I asked for and I would appreciate it if I could get some help with what I actually needed help with, not with the jumping (which I can debug in due time)

    Chat