PDA

View Full Version : Securty game cop search light script


cdiamond
07-24-2008, 06:04 AM
I am making a game and currently I have a Cop instanced cop which is basically a circle with a triangle in front as its "searchlight"but right now the "search light" can see through the "walls" instanced wall I want the triangle to temporarily erase the bits that are touching the wallsbut then when they arnt i want them to come back any help waould be appreciated

papastiffy
07-24-2008, 06:08 AM
I wouldn't know how to graphically change (or morph) the triangle, but in order to have it not be able to "see through walls", you would probably just need to test the triangle for the player collision before testing for the wall.

If the wall collides first, set a quick variable, and if it hits the player on the other side of the wall as well, its a null action.

jrashag
07-24-2008, 08:51 PM
I wouldn't know how to graphically change (or morph) the triangle, but in order to have it not be able to "see through walls", you would probably just need to test the triangle for the player collision before testing for the wall.

If the wall collides first, set a quick variable, and if it hits the player on the other side of the wall as well, its a null action.

Throwing this out there, but maybe on top of something like the above, recolor that portion of the "light" that's colliding with the background to have an alpha of 0?