Bitmap collision detection in VB6
- From: Brigand <markashall@xxxxxxxxxxx>
- Date: Wed, 12 Dec 2007 07:03:29 -0800 (PST)
Hi guys,
I am currently trying to redesign a game I have been working on a
while, and I have hit a stumbling block. I'll try to succintly
describe the problem:
Currently, my game does collision detection as the standard, good
ole'
fashioned intersecting rectangles calculation - simple enough, and
not
too processor intensive for the most part. This works GREAT for
sprites. But not so great for the ground/background/environment.
The downside is that I have to basically map rectangles to every part
of my environment, over the top of whatever image I draw for the
background. It works.....but is not very elegant, and requires a mind
numbing amount of work mapping rectangles and checking each and every
one of them for collisions on each screen.
What I would LIKE to do is draw my background, and import it as a
bitmap, and use some sort of algorithm to determine collisions with
the bitmapped image. The best I have been able to come up with is to
either use one color for the 'empty space' (the part that doesn't
inhibit movement), and simple flag a collision anytime a color is
detected at one of the four corners of a sprite, OR a variation of
this where the background is one or 2 predefined colors, and any
intersection with that color flags a collision. This works kinda
sorta
OK, but it really limits what my backgrounds can look like color-
wise.
I really don't want to rely on one or 2 color 'solid' ground, or
always having a black background from an artistic standpoint; it
really limits the visual appeal of the game.
Does anyone have a suggestion for how to implement collision
detection
on imported bitmap backgrounds??
Thanks for any advice you can give!!
.
- Follow-Ups:
- Re: Bitmap collision detection in VB6
- From: Mike Williams
- Re: Bitmap collision detection in VB6
- From: Auric__
- Re: Bitmap collision detection in VB6
- Prev by Date: Re: MousePointer
- Next by Date: Re: Bitmap collision detection in VB6
- Previous by thread: MousePointer
- Next by thread: Re: Bitmap collision detection in VB6
- Index(es):
Relevant Pages
|