hi, i have a question about somethgin in scratch. i'm buildign a game where i have to detect where the enemy is without using the point toward tool, so i was wondering, if there is another way that i can detect the enemy so that i can fire accurately at it, and that i can know wehre the enemy is and try to stay away from it, any help is appreciated thank you!
Offline
distance to sprite is your only hope and friend right now.
<when green flag clicked>
<forever>
<if><( <distance to[ obj <>> 50 )>
Action if your distance to object is greater then 50
<end>
Last edited by Kezio (2008-11-29 03:20:28)
Offline
You could use the "X of sprite" "Y of sprite" blocks, or a detector sprite that rotates around your main sprite like a radar.
Offline
yoyoma wrote:
thanks everyone fo your help!! ^^ XD
Is it a Tower Defense project? I'm working on one myself... behold my enemy script:
<when green flag clicked>
hey, no lists?! delete (all) of Add1
add (one) to Add1
<set{health}to(Add1
<go to x:(51)y:(172
<hide>
<forever>
<if><(health<=>0)>
<hide>
<end>
<if><touching color[green
<broadcast[pwned
<end>
<end>
<when green flag clicked>
<set{health}to(Add1
<show>
add ((<health><+>1)) to Add1
*MOVEMENT DETAILING*
<hide>
<when I receive[POW!! (hit)
<change{health}by(-1
There... phew!
Offline
its not a tower defence project, the project that i'm making is that i build a robot or anything that uw ant it to be and that it roams around the map aiming at enimies who is constantly moving at random directions, i tried to use trig. triangulation to figure out how to do it but so far i'm still stuck.....
Offline