ok I followed tonyg's code a little more closely, it was as I suspected. The missile code was fine, it was just an explosion for each impact that wasn't being done.
so I added a create function for the explosion, then put the update and draw functions in the main loop. The update does an update for each explosion and the draw, draws each explosion.
the create function is called in my collision code when the missile impacts a target, which starts the ball rolling updating it and drawing it.
I had the drawing stuff basically in the update, and then I called the draw function in the update function, these ways didn't work. I wanted this way though to avoid putting more than neccessary in the loop.
i think i can probably put them all now in one function and call that function in the loop
func goInLoop()
update()
draw()
end func
put goInloop() in the main loop? :)
so I added a create function for the explosion, then put the update and draw functions in the main loop. The update does an update for each explosion and the draw, draws each explosion.
the create function is called in my collision code when the missile impacts a target, which starts the ball rolling updating it and drawing it.
I had the drawing stuff basically in the update, and then I called the draw function in the update function, these ways didn't work. I wanted this way though to avoid putting more than neccessary in the loop.
i think i can probably put them all now in one function and call that function in the loop
func goInLoop()
update()
draw()
end func
put goInloop() in the main loop? :)