I'm teaching C++ in my technical school, and I wanted to introduce my class in games world with some simple experiences.
We are making a very simple arcade game, where a ship (^) fires some shots (* . ! A) and so on.
We made it with simple functions, and it worked, but cannot fire more than a projectile simultaneously. So, I decided to buid a class.
But, the main problem is that I have to create one shot when I press the keyboard (and this worked), but it have to keep moving even after I release it. And, when I press again, I want to have another shot created (and moving). How to do this?
If helps to understand, follow the class:
typedef struct fire
void shoot(int i)
runTime = clock();
cannon(int x,int y, int i)
arms[i].x = x;
arms[i].y = y;