Computer Science Canada shooter game -- checking colisions |
Author: | xHoly-Divinity [ Mon Jan 17, 2005 8:12 pm ] | ||
Post subject: | shooter game -- checking colisions | ||
I am not sure if this attatchment will successfully attatch. If it does you can see that I have all the characters, the target, and the explosion after you shoot. If you cannot, I will post a copy of the code so perhaps you can sort of make it out (there are picture attatchments, so this is why just the source code will not work). Anyhow, my problem is I don't know how to check it a person has been shot or not. Because this is a sophisticated .bmp image with uneven edges/shapes, I can't really use Math.Distance. If I use whatdotcolour, there would be at least 200 different checks that I would have to conduct. I've tried using a check to see for whatdotcolor if it doesn't match any of the bg colors but this too is a lot of code and some bg colours appear in the .bmp images. Help needed! Thanks!
|
Author: | xHoly-Divinity [ Mon Jan 17, 2005 8:25 pm ] |
Post subject: | |
P.S. I appologize if i've offended anyone |
Author: | Neo [ Mon Jan 17, 2005 10:44 pm ] | ||
Post subject: | |||
![]() To answer your question, You could use whatdotcolour, since your background consists of mosly solid colours. You could do something like
Just make sure when you do this, none of your targets have white on them, since the background is white, or any of the colours you used for your boxes and barrel. Alternatively you could use rectangle and circle detection. For the head use circles and for the shoulders use a rectangle. To make it more accurate use more smaller circles for irregular bumps. |
Author: | xHoly-Divinity [ Tue Jan 18, 2005 3:24 pm ] |
Post subject: | |
Yes, but as mentioned before, there are some colors in the background that are similar to the colors in the .bmp. Also, I want to make different things happen if you shoot a different person. ![]() |