How do I make pixel precision movement

Get help using Construct 2

Post » Fri Aug 22, 2014 12:38 am

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:
Image

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!
Last edited by Patomanriquezb on Fri Aug 22, 2014 1:06 am, edited 1 time in total.
B
5
Posts: 4
Reputation: 391

Post » Fri Aug 22, 2014 12:40 am

im not sure if this what you what but have you tried turning off Pixel rounding and setting sampling to point
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Fri Aug 22, 2014 12:55 am

Pixel rounding is off and sampling is on point.
B
5
Posts: 4
Reputation: 391

Post » Fri Aug 22, 2014 12:59 am

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:
Image
B
5
Posts: 4
Reputation: 391

Post » Fri Aug 22, 2014 8:12 am

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)
B
40
S
16
G
6
Posts: 543
Reputation: 7,649

Post » Fri Aug 22, 2014 3:12 pm

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.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests