Physics trouble

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.
Post Reply
C++arl
Prole
Posts: 2
Joined: Thu Mar 04, 2010 11:38 pm

Physics trouble

Post by C++arl »

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:

Image

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
:megagrin:
Attachments
gameTest.love
(702.25 KiB) Downloaded 202 times
treeturtle
Prole
Posts: 11
Joined: Wed Feb 24, 2010 9:45 pm
Location: Michigan

Re: Physics trouble

Post by treeturtle »

yeah i have no clue how to fix that, but i know how to bump!

bump
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Physics trouble

Post by Robin »

I tried it, but had no such problem.
Help us help you: attach a .love.
pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Re: Physics trouble

Post by pekka »

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.
C++arl
Prole
Posts: 2
Joined: Thu Mar 04, 2010 11:38 pm

Re: Physics trouble

Post by C++arl »

Aha okay, i see how it works now. Very cool, works swell now, thank you all! :ultraglee:
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests