Ok, so I am making a zombie apocalypse game. However, I'm having some trouble trying to get the zombie to chase people. I want the zombie to chase any of the people that get near it, but I don't won't to make a ?
for every single person I make. Is there any way I can make 1 ?distance toperson ▼
work for all of the people?distance toperson ▼
Offline
Nope. D: Sometimes you just have to tough it out.
Offline
I can't think of anyhing
Offline
Not really. You could put all of the distances in a list with a loop and look for the lowest number
Offline
Well you could name the people "1", "2", "3", etc. Then you use the script:
And this way, you only have to copy and paste the middle thing as many times as you need to, instead of doing each individual.whenclicked
setchase ▼to0foreversetmin-dist ▼to1000setsprite ▼to0changesprite ▼by1ifdistance to<spritemin-distsetmin-dist ▼todistance tospritesetchase ▼tospritechangesprite ▼by1ifdistance to<spritemin-distsetmin-dist ▼todistance tospritesetchase ▼tospritechangesprite ▼by1ifdistance to<spritemin-distsetmin-dist ▼todistance tospritesetchase ▼tospritechangesprite ▼by1ifdistance to<spritemin-distsetmin-dist ▼todistance tospritesetchase ▼tospritechangesprite ▼by1ifdistance to<spritemin-distsetmin-dist ▼todistance tospritesetchase ▼tospriteifchase>0point towardschasemove5steps
Last edited by AtomicBawm3 (2012-03-01 19:48:34)
Offline