Hallo to all.
I have a piece of code that allow me to create object and move them across the screen following a path that i load from a file.
Those object fire at the player that is controlled by the mouse.
Each object (player,enemy bullet,enemy,player bullett) are a separate type.
And when an object is deleted i play a small explosion anim.
My problem is that when i shoot a enemy all is ok,but when the enemy axplode i see ALL other object of the same type flicker (like for a fraction of a second they disappear and appear)!
If explode an alien...ALL alien flicker(it seems that the flicker don't afect other types...).
I use a function to move all alien,a separate function to move enemy bulle,and so on for the other movement.
Each movement is in this manner "for a.alieno = each alieno".
The code for the collision is inside the bullet move function (if i put elsewere the collision don't work...don't know why)and works in this manner "for a.bullet = each bullet------move bullet for a.alieno = each alieno----calculate collision----if collision delete a----exit (to prevent error)----next----next".
Someone know if the flicker is caused in my method of doing collision?(in every demo that i made with collision i see this effect....sometimes smaller and somethimes [like with this demo...] very annoying).
Thanks.
I have a piece of code that allow me to create object and move them across the screen following a path that i load from a file.
Those object fire at the player that is controlled by the mouse.
Each object (player,enemy bullet,enemy,player bullett) are a separate type.
And when an object is deleted i play a small explosion anim.
My problem is that when i shoot a enemy all is ok,but when the enemy axplode i see ALL other object of the same type flicker (like for a fraction of a second they disappear and appear)!
If explode an alien...ALL alien flicker(it seems that the flicker don't afect other types...).
I use a function to move all alien,a separate function to move enemy bulle,and so on for the other movement.
Each movement is in this manner "for a.alieno = each alieno".
The code for the collision is inside the bullet move function (if i put elsewere the collision don't work...don't know why)and works in this manner "for a.bullet = each bullet------move bullet for a.alieno = each alieno----calculate collision----if collision delete a----exit (to prevent error)----next----next".
Someone know if the flicker is caused in my method of doing collision?(in every demo that i made with collision i see this effect....sometimes smaller and somethimes [like with this demo...] very annoying).
Thanks.