Page 1 of 1
Could somebody point me to an example?
Posted: Thu Jan 30, 2014 2:55 am
by Diebuster.Fan
Hi, I joined earlier today, and I think LÖVE looks like a tool I definitely would like to use. I've read all the tutorials on the wiki and am only starting to get used to Lua, but I'm having some issues understanding a few things. I'm sure some game in the Projects board has what I'm looking for, but I haven't had any luck. Is there any game I could see, download, and pick apart that plays sort of golf-ish or Angry Birds-esque in that the player launches the object, and the object bounces to a standstill?
If anybody could point me in the right direction, I'd appreciate it.
The picture shows what I'm hoping for an example of.
Re: Could somebody point me to an example?
Posted: Thu Jan 30, 2014 6:28 am
by micha
Hi and welcome to the forum,
Angry Birds is written using Box2d for the physics. This is also available in LÖVE via the love.physics module. I suggest you have a look at the
tutorial on the wiki. Especially at those about physics.
Re: Could somebody point me to an example?
Posted: Thu Jan 30, 2014 8:22 am
by Diebuster.Fan
Thank you. I've actually been finding
https://love2d.org/wiki/love.physics pretty helpful. If I can figure out how to visually replace shapes with sprites, I might be able to start getting work done.
Re: Could somebody point me to an example?
Posted: Thu Jan 30, 2014 9:15 am
by Azhukar
Diebuster.Fan wrote:Thank you. I've actually been finding
https://love2d.org/wiki/love.physics pretty helpful. If I can figure out how to visually replace shapes with sprites, I might be able to start getting work done.
You can use this
http://love2d.org/forums/viewtopic.php?f=5&t=77140 as a start for drawing your physics world.
Re: Could somebody point me to an example?
Posted: Thu Jan 30, 2014 9:19 am
by Plu
Diebuster.Fan wrote:Thank you. I've actually been finding
https://love2d.org/wiki/love.physics pretty helpful. If I can figure out how to visually replace shapes with sprites, I might be able to start getting work done.
It's important to understand you don't
replace shapes with sprites, you draw sprites
on top of shapes.
If you have the coordinates of a shape, you can use those same coordinates to draw a sprite in the same location. (But! Important! The coordinates of the shape are the
center of the shape, so you need to offset the image which by default uses the coordinates given as the top-left part of the image)
Re: Could somebody point me to an example?
Posted: Thu Jan 30, 2014 9:52 am
by Diebuster.Fan
Yeah, I know that I don't replace the shape, but I need to make it hidden, so that you don't see a shape behind the sprite.
Re: Could somebody point me to an example?
Posted: Thu Jan 30, 2014 9:55 am
by slime
What you see is what you draw. There is no visible shape (only an invisible one that just interacts with love.physics) unless you draw one yourself in love.draw.
Re: Could somebody point me to an example?
Posted: Thu Jan 30, 2014 10:08 am
by Diebuster.Fan
Alright, thanks. I hope to post again soon with something worth putting in the projects board. Right now, I have a lot of learning to do.
Re: Could somebody point me to an example?
Posted: Fri Jan 31, 2014 7:35 pm
by jjmafiae
Physics are a heavy hammer if you are still learning I don't recommend you trying to make a game with it.