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
Physics Issues
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Physics Issues
- Attachments
-
- platformer.love
- (22.6 KiB) Downloaded 235 times
It was the best of times, it was the worst of times . . .
Re: Physics Issues
I can't even get it to load. When I run it from the terminal I get this:
I haven't used the physics module yet, so I won't even know where to start.
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$
Re: Physics Issues
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.
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.)
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.
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 219 times
It was the best of times, it was the worst of times . . .
Re: Physics Issues
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.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Physics Issues
It means that a shape was too small. Box2D only works with shapes in a certain size range.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.
Help us help you: attach a .love.
Re: Physics Issues
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 . . .
Re: Physics Issues
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
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Physics Issues
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
Re: Physics Issues
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.
Re: Physics Issues
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?
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 . . .
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], pgimeno and 14 guests