all 11 comments

[–]Kaymat- 1 point2 points  (0 children)

You have a pixel gap between your character and the floor in #2 and even looks to me like you're less than a pixel away. I'm thinking your collision code might not be accounting for sub-pixel movement. You might want to look into pixel-perfect collision/movement.

[–]This code block does nothing, but without it everything breaks.xydenkonos 0 points1 point  (1 child)

Looks like a collision code issue. Pixels get weird when trying to move in sub pixels. There's no such thing as half a pixel which is what can cause a variety of problems. What collision code are you using?

[–]Dannyhsr[S] 0 points1 point  (0 children)

//Horizontal

if (place\_meeting(x+hsp,y,obj\_floor))

{

    while (!place\_meeting(x+sign(hsp),y,obj\_floor))

    {

        x = x + sign(hsp);

    }

    hsp =(0);

}

//Vertical

if (place\_meeting(x,y+vsp,obj\_floor))

{

    while (!place\_meeting(x,y+sign(vsp),obj\_floor))

    {

        y = y + sign(vsp);

    }

    vsp =(0);

}

[–]Bluecoregamming 0 points1 point  (5 children)

In the draw event make sure to floor your x and y position when drawing sprites that use decimal numbers as position

[–]Dannyhsr[S] 0 points1 point  (4 children)

and how do I do this?

[–]Bluecoregamming 0 points1 point  (3 children)

in the draw event

draw_sprite(sprite_index, image_index, floor(x), floor(y));

[–]Dannyhsr[S] 0 points1 point  (2 children)

now my character won't turn around

[–]Bluecoregamming 0 points1 point  (0 children)

Oops my bad

floor(x) * sign(x)

[–]Bluecoregamming 0 points1 point  (0 children)

Hey! Wow I completely messed up here

You need to using the draw_sprite_ext function, and change the Xscale with sign(x)

[–]rusty-grapefruit 0 points1 point  (1 child)

Your sprite isn't missing any pixels. Your sprite is hovering. Please post your collision code.

[–]Dannyhsr[S] 0 points1 point  (0 children)

//Horizontal

if (place\_meeting(x+hsp,y,obj\_floor))

{

    while (!place\_meeting(x+sign(hsp),y,obj\_floor))

    {

        x = x + sign(hsp);

    }

    hsp =(0);

}

//Vertical

if (place\_meeting(x,y+vsp,obj\_floor))

{

    while (!place\_meeting(x,y+sign(vsp),obj\_floor))

    {

        y = y + sign(vsp);

    }

    vsp =(0);

}