here, I'll give you a little push in the direction I think you want to go
bug {
vec2 pos
bool drawFlag = true
bool collisionFlag = false
int collKillTimer = 0
}
container bugs[n]
draw ship
draw bullet
move bullet up
for each bug in bugs
#
is bug.drawFlag true
check collision and set state
if collision
bug.drawFlag = false
bug.collisionFlag = true;
bug.collisionKillTimer = 1.0
reset bullet
#
if bug.collisionFlag is true
draw collision
else
if(bug.drawFlag is true)
draw bug
function timer
for each bug in bugs
if(bug.collisionKillTimer > 0)
bug.collisionKillTimer -= elapsedTime;
if(bug.collisionKillTimer <= 0)
bug.collisionFlag = false
the tools are difficult like this. but usable. Now, what is wrong with this design? Should time be part of the object? Should the object care that there is a collision image, maybe it should only care that it has a representation image and let some other system handle collision drawing...see how this works?
You are the one that has to care what the design looks like. It's looking like you really were not ready for more than one bug. If you can't get this, then I fear again, all is lost and we'll have to back up even further.