Bitmap collision detection in VB6



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!!

.



Relevant Pages

  • Re: Bitmap collision detection in VB6
    ... Currently, my game does collision detection as the standard, good ... on imported bitmap backgrounds?? ...
    (comp.lang.basic.visual.misc)
  • Re: Bitmap collision detection in VB6
    ... rectangles calculation - simple enough, ... sprite collision detection, and it is *very fast* in a compiled exe ... does contain a black pixel then the actual sprite pixels are touching, ... bmp file. ...
    (comp.lang.basic.visual.misc)
  • Re: new here, my lang project...
    ... > computer game. ... > the end of that time slice ends in a new collision, ... > plane view because it is more efficient for some game entities when one is ... >> movetypes basically allow one to specify various sets of physics features ...
    (comp.object)
  • Re: Collision detection
    ... top and bottom as well as "bounce" off each other. ... Not entirely sure what you mean by elastic here but the collision ... I have attempted the collision detection but ... see if any point is included in both rectangles, ...
    (microsoft.public.vb.general.discussion)
  • Re: Bitmap collision detection in VB6
    ... and any intersection with that color flags a collision. ... on imported bitmap backgrounds?? ... detection so I've never had to work this out myself. ...
    (comp.lang.basic.visual.misc)