Physics, applyImpulse, dt and other things

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
counterfactual_jones
Prole
Posts: 24
Joined: Mon Feb 09, 2009 10:14 am

Re: Physics, applyImpulse, dt and other things

Post by counterfactual_jones »

You forgot

Code: Select all

   world:setCallback(handle_collision)
inside load(), without this handle_collision doesn't get called when collisions occur in the world. (Because world doesn't know that 'handle_collision' exists.)
Broncheabones
Prole
Posts: 15
Joined: Wed Feb 04, 2009 5:25 am

Re: Physics, applyImpulse, dt and other things

Post by Broncheabones »

Jones, I fucking love you. You fixed it, this is awesome. I wondered why it wasn't working and why I had never heard of a handle_collision function. Thanks a lot dude.

Now that I'm over that hump I just need to learn everything else! Thanks guys, you've been a huge help.
Broncheabones
Prole
Posts: 15
Joined: Wed Feb 04, 2009 5:25 am

Re: Physics, applyImpulse, dt and other things

Post by Broncheabones »

Just in case anyone wanted to see the fruits of my labors thus far, here it is. Thanks to everyone who helped. Next I'll be adding multiple levels and maybe even power-ups! I know it's extremely simple but hey, it's my first.
Attachments
Marble Game.love
(443.85 KiB) Downloaded 167 times
User avatar
counterfactual_jones
Prole
Posts: 24
Joined: Mon Feb 09, 2009 10:14 am

Re: Physics, applyImpulse, dt and other things

Post by counterfactual_jones »

Great! Three minor issues and one is my fault.

1. You did a zip (rar actually, which I'm not sure but that might have to be a zip) of the folder. Lua won't find main.lua unless it's in the root of the zip (i.e. not in a folder inside the zip file)

2. Finish.png and Finish_text.png are capitalised, but aren't in your code, and so it gives an error.

3. (And this is a fault of what I suggested you do) If you hug a wall, the collisions are such that you can 'wall jump' if you keep pressing the jump key when you reach the apex of the jump. Not sure how to fix that, probably an embellishment upon the simple 'y < cy' check

Otherwise it's a fine first game, you certainly beat my graphics.
Broncheabones
Prole
Posts: 15
Joined: Wed Feb 04, 2009 5:25 am

Re: Physics, applyImpulse, dt and other things

Post by Broncheabones »

I'm going out of order because... I have no reason, I just answered them in this way then typed this.

3. I also fixed a little problem in your code that if you "Walked off a ledge" you could jump at any point after falling which is why I have the 1 > y > -1 in there. As for the wall thing, not quite sure what I'll do about that.

1. I wondered why the .love wasn't working so well, I just thought that would be better than having someone yell 'OMFG RENAME THE FILE NOOB'

2. I don't seem to experience any errors as far as the graphics go, that's weird. I just played through and had no problems.

Thanks, I probably spent more time on the graphics then anything :ehem: , I'm a total vanity freak. I also made lots of different designs for the ball which I will probably use in later versions to the game.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Physics, applyImpulse, dt and other things

Post by bartbes »

counterfactual_jones wrote:2. Finish.png and Finish_text.png are capitalised, but aren't in your code, and so it gives an error.
Broncheabones wrote:2. I don't seem to experience any errors as far as the graphics go, that's weird. I just played through and had no problems.
Well counterfactual_jones is right, while it might give no problems on your pc (let me guess, you're using windows), there are problems on OSes that are case-sensitive (yes, filenames can be case-sensitive).
Broncheabones
Prole
Posts: 15
Joined: Wed Feb 04, 2009 5:25 am

Re: Physics, applyImpulse, dt and other things

Post by Broncheabones »

bartbes wrote:Well counterfactual_jones is right, while it might give no problems on your pc (let me guess, you're using windows), there are problems on OSes that are case-sensitive (yes, filenames can be case-sensitive).
Bah, you've got to be kidding me! So stingy. I suppose I'll have to test everything through my brothers Mac Book to make sure I don't screw it up again.
Post Reply

Who is online

Users browsing this forum: No registered users and 205 guests