PDA

View Full Version : Detect where a moveable object is??


davehardyuk
04-20-2005, 08:12 PM
Hi guys, i have a moveable man in a game. I was wondering how i would detect where he was on the stage. I have tried using hittest with an invisible object but i can't get it to work.

Any ideas?

p.s the stage is split into a grid of 4, i want to detect which part of the grid he is in.

Thanks alot, Dave. :confused:

false
04-20-2005, 08:40 PM
Why not try using MovieClip.localToGlobal()?

....and THEN test if the _x's and _y's are withing your boundries.

MichaelxxOA
04-20-2005, 09:15 PM
or you could just the movie's x and y values

trace(man_movie._x);
trace(man_movie._y);

if you replace the man_movie with your guy's instance name that will give you his x and y values respectively...

how exactly are you trying to use this, if you explain things a bit better we can answer better.
-Michael