Physics Issues

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
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Physics Issues

Post by Refpeuk »

Hi all,

My physics-based platform game is doing some weird stuff. When my character runs (collision block slides) from one shape to another he freezes and shows my jumping sprite. I have no clue why this is - shouldn't it just slide?

I've attached my .love file.

Thanks
Attachments
platformer.love
(22.6 KiB) Downloaded 198 times
It was the best of times, it was the worst of times . . .
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Physics Issues

Post by MarekkPie »

I can't even get it to load. When I run it from the terminal I get this:

Code: Select all

[redacted]:~/Downloads/LOVE$ love platformer/
love: modules/physics/box2d/Source/Collision/Shapes/b2PolygonShape.cpp:225: b2PolygonShape::b2PolygonShape(const b2ShapeDef*): Assertion `d.y >= 0.0f' failed.
Aborted
[redacted]:~/Downloads/LOVE$ 
I haven't used the physics module yet, so I won't even know where to start.
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Physics Issues

Post by Refpeuk »

Hmm, interesting. I know it works; I've tried that exact file. It's built for 0.7.2, I can confirm it doesn't work in 0.8.0 so maybe that's the issue.

Anyway, no matter. I came up with a solution; the issue was how I was handling collision callbacks and enabling/disabling jump. I changed it to a counter instead of a boolean and now it works fine.

Sorry for the pointless post. If anyone wants to look through my code feel free to give as much (hopefully constructive) criticism as you want. As this is my first game it's a real learning experience.

Thanks for the reply Marekkpie, it seems as you're always around to help. :awesome:

I've attached my fixed code so anyone who wants to can learn from my mistake. (I forgot to mention in my first post, you can place blocks with lmb, move them with rmb, and select different types of blocks to place with the number keys.)
Attachments
platformer.love
(22.6 KiB) Downloaded 189 times
It was the best of times, it was the worst of times . . .
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Physics Issues

Post by MarekkPie »

No problem. Reading the error code some more, it looks like it is a C issue, and for whatever reason, one of your shapes had a nonpositive float.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Physics Issues

Post by Robin »

MarekkPie wrote:No problem. Reading the error code some more, it looks like it is a C issue, and for whatever reason, one of your shapes had a nonpositive float.
It means that a shape was too small. Box2D only works with shapes in a certain size range.
Help us help you: attach a .love.
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Physics Issues

Post by Refpeuk »

Why does it not give me that error? Is anyone else able to run it?
It was the best of times, it was the worst of times . . .
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Physics Issues

Post by Nixola »

Maybe, but not me
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Ellohir
Party member
Posts: 235
Joined: Sat Oct 22, 2011 11:12 pm

Re: Physics Issues

Post by Ellohir »

I have run it, though I have PO2 so instead of a player I see a white box. But a very nice and jumpy white box :awesome:
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Physics Issues

Post by MarekkPie »

Still can't get it to run. The only other thing may be that in fiddling with other random engines, some library or dependency was overwritten.
User avatar
Refpeuk
Citizen
Posts: 91
Joined: Wed Dec 14, 2011 6:16 pm

Re: Physics Issues

Post by Refpeuk »

This is really strange: I thought the code was supposed to be portable. How dis you run it? I use love 0.7.2 and drag the .zip or .love onto a love.exe inside the folder with DevIL.dll, OpenAL32.dll, and SDL.dll.

When it doesn't work does it crash to desktop with a windows "love.exe" stopped working error, or do you get a love error message.

PS: What's PO2, Ellohir?
It was the best of times, it was the worst of times . . .
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 216 guests