Is there any way you can check if dbDot do collision with a enemy?
heres code
#include "darkgdk.h"
#include "Dinput.h"
struct BULLET{
bool Active;
float x,y;
float dx,dy;
void Update(void);
}Bullet[500];
void BULLET::Update(void){
x+=dx;
y+=dy;
dbDot(x,y);
}
void WeaponM4Fire(void)
{
for (int i=0;i<500;i++){
if (Bullet[i].Active) Bullet[i].Update();
if (Collision?)
{
Bullet[i].Active=false;
}
}
if (dbKeyState(DIK_W) == 1){
int i=0;
while ((Bullet[i].Active)&&(i<500)) i++;
if (i<500){
Bullet[i].Active=true;
Bullet[i].x=(dbSpriteX(1)+20);
Bullet[i].y=(dbSpriteY(1)+20);
Bullet[i].dx=9;
Bullet[i].dy=0;
}
}
}
Beginner In the Language.