Computer Science Canada erasing picture |
Author: | MyPistolsIn3D [ Sat May 01, 2004 4:40 pm ] | ||
Post subject: | erasing picture | ||
Ok, I want to erase the picture thats drawn when its hit by bullet fire in my game, but there is multiple pictures on the screen all in one array. how do I do it?
|
Author: | Delos [ Sat May 01, 2004 4:52 pm ] |
Post subject: | |
You could: - have a boolean operator that decides whether the pic is drawn or not - once hit by the fire, it turns off (false), thus in your next redrawing of the screen, the pic is omitted - draw the bg over it. If you have a single colour, cls could work - if you have a limited number of colours being used, PicXOR could work... |
Author: | MyPistolsIn3D [ Sat May 01, 2004 5:22 pm ] |
Post subject: | |
yea, I've tried doing all those but I cant incorporate it into the array right... |
Author: | Tony [ Sat May 01, 2004 5:28 pm ] |
Post subject: | |
you could keep images in a flexable array, and when you want to delete an image, you swap image to be deleted with the last element, then resize array down one point, effectivly eliminating the image. though you'd have to run your forloops using Upper(arrayName) so you dont get out of range error |
Author: | MyPistolsIn3D [ Sat May 01, 2004 5:40 pm ] |
Post subject: | |
Ok, i get what you mean tony, but how would i go about doing that? Could you give me an example or sumthing? thx. |
Author: | Tony [ Sat May 01, 2004 8:55 pm ] | ||
Post subject: | |||
sure
|
Author: | MyPistolsIn3D [ Sun May 02, 2004 10:42 am ] |
Post subject: | |
thank you very much |
Author: | MyPistolsIn3D [ Sun May 02, 2004 5:41 pm ] |
Post subject: | |
I cant get it to work, i've been working on it all day.... any other ideas? or should I do it another way? |