Object Array in a Game

I'm trying to program a basic game. I have a ship that I cant move but I can't get it to shoot. I'm using an array of bullet objects which a for loop goes through checks a boolean and if boolean is false it moves that bullet to the players position and sets boolean to true. The bullet then moves and when it goes off the screen it sets the boolean to false which stops the game drawing and updating the boolean. At the moment when I use the function to shoot nothing happens. I don't know if the is a problem with the boolean, the function checking the boolean to draw it or the bullets being created at all.

I would really appreciate some advice.
Thank you.
Time to learn to debug.

I suggest you start by adding logs. Dump to screen or file simple things like:

cout << "There are.... " << bulletVector.size() << " bullets to process" << endl;

and

cout << "Bullet number 0, boolean is set to " << bulletVector[0].someBoolean << endl;

If you make good logs, you'll be able to simply read them and see where what you think should happen isn't happening.
Topic archived. No new replies allowed.