0 Favourites

How do I make pixel precision movement

  • Hello

    I've been playing around with construct 2 for a while, always with the idea of making a pixel art game.

    But there is something I still can't manage to do. I've searched for a solution but I can't seem to find it.

    The thing is I can't make my sprites move pixel by pixel, as construct movement is linear it kind of breaks the whole pixelated feel of the game. I did some research and made an attempt with custom movement and the round() function, but I still get this:

    As you can see, pixels don't align (I was just trying to align X axis, so ignore the vertival alignment).

    Does anyone know how to do this?

    Thanks!

  • im not sure if this what you what but have you tried turning off Pixel rounding and setting sampling to point

  • Pixel rounding is off and sampling is on point.

  • I didn't know, but Pixel Rounding, when on, should do the trick.

    That saves a lot of time, as I can just set the Platform Behavior to my sprite and it will move pixel by pixel.

    BUT, it's still not precise enough:

  • It's because of the way C2 scales graphics to fit with your screen resolution. If the screen resolution isn't divisible with your game resolution then you get slightly misaligned pixels. This here should work: Project Settings -> Fullscreen Scaling : Low Quality. (Don't worry, "low quality" is a misnomer)

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Here's one way you can do it. Assign the movement to a box and assign the position of the animation to that box, but instead of setting it directly to the position of the movement box, do this: (Set X to round(PlayerBox.X))

    This way it will snap to the nearest whole number. If you have double sized pixels you will have to do a little bit of math. Also I'm not sure if this works on full screen mode.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)