realbasic-games
[Top] [All Lists]

Re: Doc's on box to box

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Doc's on box to box
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Fri, 25 Feb 2005 20:14:09 -0600
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <421FCCCF dot 3000908 at earthlink dot net>
At 7:11 PM -0600 2/25/05, Eric Richards wrote:

Does anyone know of any documents that I can download
that relate to collision detection of a "box to box" type - with
respect to 2D sprites?

I don't know of any documents, but box/box tests in 2D are pretty trivial. Assuming that b1 and b2 are the bounds objects of the two sprites, each with left/top/right/bottom properties. Then, they're overlapping if

  b1.right > b2.left and b1.left < b2.right and _
  b1.bottom > b2.top and b1.top < b2.bottom

Best,
- Joe

--
REAL World 2005 - The REALbasic User Conference
March 23-25, 2005, Austin, Texas
<http://www.realsoftware.com/realworld>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>