Hello again,
It's been a long time since I tried to communicate with this community. Previous experience wasn't very pleasing. But I hope to get some feedback this time.
(And again, I'm not a native english speaker. So I apologize for any mistakes in this and other posts. It's not on purpose.)
I'm currently working on my game project, and I already have a working math and physics in pure Lua. So it is time to move it into LOVE. But I am not very sure about measuring units LOVE use. As a matter of fact, my game use real-world measuring units, such as: meters, kilograms, meters per second, seconds.
So the question is: Am I constrained to pixels in LOVE, or pixel can represent any measuring unit (meter, for instance)?
I must apologize, as this question may seem noob-ish for you. But I hope you can help me in this matter. Thank you.
Question regarding measuring units
Re: Question regarding measuring units
Whenever you draw something in LÖVE, then the number you put into the drawing-command measures in pixel.
However, it is a good idea to separate the in-game mechanics from the graphics. This is what you do, since your calculations are in meters. All you need is the functionality, that calculates the screen coordinates (in pixel) given the physical coordinates (in meters). This is often done by some sort of camera library. But it is also not difficult to write it your self using love.graphics.translate and love.graphics.scale.
However, it is a good idea to separate the in-game mechanics from the graphics. This is what you do, since your calculations are in meters. All you need is the functionality, that calculates the screen coordinates (in pixel) given the physical coordinates (in meters). This is often done by some sort of camera library. But it is also not difficult to write it your self using love.graphics.translate and love.graphics.scale.
Check out my blog on gamedev
- misterspok
- Prole
- Posts: 20
- Joined: Fri Apr 19, 2013 12:40 pm
Re: Question regarding measuring units
I looked at the scale function in the Wiki, and I think that this is what I really need! This way I can make my physics module to think that, say, 1 pixel is 1 centimeter, and then scale axises as I want! Thank you for that tip
P.S. I still think that this forum should get Q&A thread, so nobody has to start a new thread to ask a question like this one. Maybe moderators could react, at least somehow?
P.S. I still think that this forum should get Q&A thread, so nobody has to start a new thread to ask a question like this one. Maybe moderators could react, at least somehow?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Question regarding measuring units
We have an entire subforum dedicated to questions, and a search function. This is definitely a better resource than some FAQ.misterspok wrote:P.S. I still think that this forum should get Q&A thread, so nobody has to start a new thread to ask a question like this one. Maybe moderators could react, at least somehow?
If instead you mean a thread where everyone can ask their questions, what would be the difference? Except for it being harder to find, read, etc.
- misterspok
- Prole
- Posts: 20
- Joined: Fri Apr 19, 2013 12:40 pm
Re: Question regarding measuring units
Well, I just thought it will be more convenient. But if you say so, let it be as it is.
Anyways. Thanks to Micha's heads up and my VERY scarce knowledge of LOVE, after about hour and a half I now have a working prototype of my project! It displays main flight data and daws a trajectory You also can change engine power and burn vector angle using WSAD keys, and burn when LMB pressed. I implemented real liquid fuel rocket engine physics and real atmosphereless flight model.
Anyways. Thanks to Micha's heads up and my VERY scarce knowledge of LOVE, after about hour and a half I now have a working prototype of my project! It displays main flight data and daws a trajectory You also can change engine power and burn vector angle using WSAD keys, and burn when LMB pressed. I implemented real liquid fuel rocket engine physics and real atmosphereless flight model.
Who is online
Users browsing this forum: slime and 7 guests