Dynamic Object Creation

Hey everyone,

I am currently working on a game project and I can be considered as new to C++. My problem is this:

I have a character in the game. I would like him to fire a bullet when I hit the space key. However, I would like the bullets to be an object of the bullet class, but I do not know how to create a bullet object every time the space key is hit. I mean, I can create the bullet object before the execution, though I want it to be created in run-time. I want to be able to move my character simultaneously while the bullets are moving. Do I need to use a pointer array to hold addresses of each bullet object? Or, is there something else I have to do?

Thanks in advance for your answers.
You could use std vectors or lists...

You might have a update function in your character every frame... you might wanna use this for refreshing the bullets ;-)... (No need for threading)

Hope that helped
Thank you for the respond, it helped :)
Topic archived. No new replies allowed.