Could somebody point me to an example?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Diebuster.Fan
Prole
Posts: 4
Joined: Wed Jan 29, 2014 11:27 pm

Could somebody point me to an example?

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

Image

The picture shows what I'm hoping for an example of.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Could somebody point me to an example?

Post 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.
User avatar
Diebuster.Fan
Prole
Posts: 4
Joined: Wed Jan 29, 2014 11:27 pm

Re: Could somebody point me to an example?

Post 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.
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Could somebody point me to an example?

Post 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.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Could somebody point me to an example?

Post 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)
User avatar
Diebuster.Fan
Prole
Posts: 4
Joined: Wed Jan 29, 2014 11:27 pm

Re: Could somebody point me to an example?

Post 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.
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Could somebody point me to an example?

Post 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. :)
User avatar
Diebuster.Fan
Prole
Posts: 4
Joined: Wed Jan 29, 2014 11:27 pm

Re: Could somebody point me to an example?

Post 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.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Could somebody point me to an example?

Post by jjmafiae »

Physics are a heavy hammer if you are still learning I don't recommend you trying to make a game with it.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests