The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 ViewsAlright, i've recently been learning DirectDraw7 in Visual basic 6, and I've got a simple Alien Invaders type game going, I got the enemies, bullets, and player processed. Now, I've met yet anotehr problem, I don't kow how to do rectangular collision detection to check if the Ship.RECT meets Enemy.RECT or Bullet.RECT so on and so forth.
If someone knows how to do this, I would greatly appreciate your help!
Just check to see if one of the coordinates of one rectangle is in the other rectangle.
Could you post an example code please?
Cause if I check the current X position on the ship to the CurrentX position of the enemie, it would just check for one pixel of space, which would be a shit collision system :|.
At 8/8/05 02:37 PM, mrnugger wrote: Could you post an example code please?
Cause if I check the current X position on the ship to the CurrentX position of the enemie, it would just check for one pixel of space, which would be a shit collision system :|.
if(ship.x + ship.width =< enemy.x + enemy.width and ship.x >= enemy.x) then
'It's in range of the x position
if(ship.y + ship.width =< enemy.y + enemy.width and ship.y >= enemy.y) then
'In range of the y position HIT
endif
endif
Now I forgot how the y position is handled in VB, so you may need to change some stuff around.
What may man within him hide, though angel on the outward side.
be sure to use the FastBlt function if you're not featuring any transparency or flip/rotate effects.
"no sound in ass"
Nah, I hate fastblt, I use Blt :D. ( I have transparency effects)