Article View: rec.games.programmer
Article #204Re: Collision detection PLEASE, all geniuses respond!
From: Rawn Shah
Date: Mon, 27 Jul 1992 00:18
Date: Mon, 27 Jul 1992 00:18
14 lines
1269 bytes
1269 bytes
From article <1992Jul26.181425.207@micor.ocunix.on.ca>, by goss@micor.ocunix.on.ca (Timothy D. Goss):
> How about this? Create a grid which represents the graphics screen but one
> which does not represent every pixel. Group pixels into 2x2, 4x4 etc groups.
> This grid can be used to represent the approximate location of each sprite or
> background image. To check if a sprite has collided with something simply
> check its destination position in the grid to see if any deadly objects are
> there. The contents of the grid could be id bytes or something. Each time
> a sprite is moved, its position in the grid is also updated.
Here's where some data structures could come in. Its most probable that
the actual array will be mostly empty. So I advise you to use a sparse array
instead. This will reduce the amount of memory consumed.
Rawn Shah
Technical Details
Message-ID:
<19613@optima.cs.arizona.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sol.ctr.columbia.edu!destroyer!ncar!noao!arizona!optima.UUCPReferences:
<1992Jul26.181425.207@micor.ocunix.on.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sol.ctr.columbia.edu!destroyer!ncar!noao!arizona!optima.UUCP From: shah@optima.UUCP (Rawn Shah) Newsgroups: rec.games.programmer Subject: Re: Collision detection PLEASE, all geniuses respond! Message-ID: <19613@optima.cs.arizona.edu> Date: 27 Jul 92 00:18:40 GMT References: <1992Jul26.181425.207@micor.ocunix.on.ca> Sender: news@cs.arizona.edu Lines: 14