Hi all,
I'm new to the forums and to LÖVE, so bear with me on this one. So I'm trying out the API and have done some progress but two falling boxes have gotten the best of me so far. The trouble is that they dont seem to fall quiet as you would expect them to do, have a look at this image which explains the problem better:
As you can see the boxes are stuck in an unnatural way, and i dont know why so if some experienced fella would like to give a helping hand it would be greatly appreciated. I have attached the .love package aswell so you can see what I meen by yourselfs, code and pics and all is in there ofc.
Thx
~~Carl
Physics trouble
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Physics trouble
- Attachments
-
- gameTest.love
- (702.25 KiB) Downloaded 199 times
-
- Prole
- Posts: 11
- Joined: Wed Feb 24, 2010 9:45 pm
- Location: Michigan
Re: Physics trouble
yeah i have no clue how to fix that, but i know how to bump!
bump
bump
Re: Physics trouble
The bounding box cannot be used to tell how big a physics objects is. It is an axis-aligned bounding box and thus can change size when the object rotates to different angles. It does remain a constant size when your object is a circle, though. What is basically means is the smallest rectangle with sides that align with x and y coordinate axes that can be drawn around the particular object.
You should store the image sizes somewhere for the drawShapeImage function to use, instead of trying to calculate them from the bounding box.
You should store the image sizes somewhere for the drawShapeImage function to use, instead of trying to calculate them from the bounding box.
Re: Physics trouble
Aha okay, i see how it works now. Very cool, works swell now, thank you all!
Who is online
Users browsing this forum: Nikki and 8 guests