Well yes, as Hawkblood said, all you need to do (well, the easiest way..) is to point the sprite to whereever you want to shoot and move the sprite (dbMoveSprite, will move it forward, depending on the angle), unfortunately there is no dbPointSprite function, but well i think i was using this one:
void PointSprite ( int spriteID, int x, int y )
{
float ANGLE;
int DX = x - dbSpriteX( spriteID );
int DY = y - dbSpriteY( spriteID );
int DIST = (DX * DX) + (DY * DY);
if( DIST > 0 )
{
ANGLE = dbAtanFull ( x - dbSpriteX( spriteID ), dbSpriteY( spriteID ) - y );
dbRotateSprite( spriteID , ANGLE );
}
}
I did not write it originally, i found it somewhere on the forums (a bit too old post..)
hope that helps
also keep on a note: point the bullet sprite just once when you shoot unless you want it to be following the target, so that the target sprite can move to avoid the bullet, and you can use dbSpriteCollision between the bullet and enemy sprites to check if they're colliding, if so, do damage or whatever you want
[url]
[/url]
Nothing's impossible, it's just a matter of time...