Quote: "1. Is it possible to draw multiple sprites off of 1 image, because when the projectile fires I don't want the current missile to disappear and then it just resets back at the ship again. I want to be able to have multiple sprites of the same image on the screen at the same time. If it is possible, can you explain to me how it is done.
"
dbLoadImage("bullet.bmp",1);
dbSprite(1,x,y,1); // forget exact order, SpriteID 1 and Img id=1 here
dbSprite(2,x,y,1); // forget exact order, SpriteID 2 and Img id=1 here
dbSprite(3,x,y,1); // forget exact order, SpriteID 3 and Img id=1 here
dbSprite(4,x,y,1); // forget exact order, SpriteID 4 and Img id=1 here
Quote: "
2. How do you make it so that when a certain variable is reached.
Like in my later example when it hits the top of the screen. Is it possible to remove the sprite from the screen without deleting it from the game. Or does dbDeleteSprite/dbDeleteImage not delete it from the game.
"
if( MySpriteY<-50){ // most like off top of screen
dbSpriteHide(SpriteID); // not positive about call name.. but..
};
See help for sprite visible - or sprite hide. not neceaary to delete. Green computing = recycling resources
Quote: "
The problem with this code, is that if the key is not pressed down the sprite will stop moving. Instead I would like the projectile to keep moving even if the key is not pressed down. So if you press the key the missile will fire until it hits the top of the screen, and then it will be removed from the persons view.( I couldn't think of any other way to say it.)
"
Well... You need to learn how to do arrays for this to be written properly. But lets assume one bullet for the moment.
when the user hits the key, you want to fire. When the user hits the key, you should set a bool ( bool BulletFlying; ) to true. Then you should update this bullets position WHENEVER this boolean flag is true - regardless of keypress.
then wehn bullet goes off top of screen - you set flag to false and hide the sprite.
Now, this isn't perfect - but you will like the results if you implement this. What I've described will make bullets keep shooting (one bullet actually) but when you hit kit again the bullet would start over at the gun. So to get bullet to the top of screen you would need to shoot and then wait for it to travel up the screen before shooting again.
This behavior could be remedied by simply only setting the BulletFlying flagg when the user hits FIRE AND the Bulletflying flag is false. They wont be able to shoot again until the bullet goes up off the screen and you code eresets the bullet flying flag to false as it hides the sprite.
Arrays would allow you to manage a bunch of bullets the same way... but in such a manner that you write logic once, and apply that logic to the "array of bullets". Ideally, I think this is what your after.
I doon't have time to write the whole shebang for ya - but this should get you searching google, searching these forums, and giving you ideas to try etc.
After sime dilligent effort, come back and tell us how you're fairing. Maybe you'll only need another hint or two to get it working! Don't give up though! It's not easy at first - but once you get it - you'll be hooked!