Hai hai! Long time no see!
I'm currently working on a simple 2d game in which you drive a submarine, and shoot torpedos and stuff. Now, this is my first real game, so I'm still learning alot about Dark GDK.
My problems at the moment are:
1. I have these mines, which float up to the surface of the water when you drop them. However, i want them to stay there for a while, before they dissapear. I started out by using dbWait, but then i realized that this made the whole screen freeze instead of only the mine. Are there any simple commands which lets you pause a sprite for a while?
2. I've also got torpedos. They simply just move from the submarine to the right, and when they go off the screen, they are deleted. The code is like this:
void shooting()
{
if(dbSpriteCollision(4, 0)==0)
{
if(dbShiftKey()==1)
{
dbSprite(4, dbSpriteX(2)+70, dbSpriteY(2)+20, 4);
if(dbSpriteCollision(2, 0)==0)
{
dbDeleteSprite(4);
}
}
}
dbRotateSprite(4, 90);
dbMoveSprite(4, 5);
dbRotateSprite(4, 0);
}
However, I want to be able to shoot several torpedos att the same time, not just one. I tried using a vraiable as sprite ID, which added 1 to itself each time a torpedo was created, and removed 1 every time a torpedo went outside the screen. However, this didn't seem to work.
So, I'm longing for some answeres
Cheers, Skolmen!
C++ newbie.