Page 1 of 1

How to make the physics pixelated?

Posted: Thu Jun 01, 2023 8:25 am
by notcl4y
Like, by default player moving pixel by pixel with physics is very slow, but by 1000 pixels it will be faster. Without physics 1000 pixels will be very fast. How to set the physics pixelated so it would be the same speed as without the physics? I've found love.physics.setMeter, but I don't know does this function set the physics pixelated.

Re: How to make the physics pixelated?

Posted: Thu Jun 01, 2023 9:29 am
by Bobble68
Assuming I'm understanding what you want, setMeter should be exactly what you want. Box2D works with metric units, but it needs to know how many pixels a meter is, which is what setMeter will do - it decides how many pixels a meter is. It essentially just zooms in or out depending on what value you have. Unless you mean something else (pixellated usually refers to an image, not internal physics), this should be the way to do it.

Re: How to make the physics pixelated?

Posted: Thu Jun 01, 2023 9:31 am
by notcl4y
Bobble68 wrote: Thu Jun 01, 2023 9:29 am Assuming I'm understanding what you want, setMeter should be exactly what you want. Box2D works with metric units, but it needs to know how many pixels a meter is, which is what setMeter will do - it decides how many pixels a meter is. It essentially just zooms in or out depending on what value you have. Unless you mean something else (pixellated usually refers to an image, not internal physics), this should be the way to do it.
Ok, thanks