How to make the physics pixelated?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
notcl4y
Citizen
Posts: 85
Joined: Fri Nov 25, 2022 12:23 pm

How to make the physics pixelated?

Post 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.

Code: Select all

loves_lua = "not so",
wants_to = true
User avatar
Bobble68
Party member
Posts: 156
Joined: Wed Nov 30, 2022 9:16 pm
Contact:

Re: How to make the physics pixelated?

Post 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.
Dragon
User avatar
notcl4y
Citizen
Posts: 85
Joined: Fri Nov 25, 2022 12:23 pm

Re: How to make the physics pixelated?

Post 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

Code: Select all

loves_lua = "not so",
wants_to = true
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 45 guests