I have kind of been driven by this once or twice but never givin enough info.

I am making a game how this guy walks around. But there are enemies! When you get close enough to the enemy it will see you. How can I do something how when you get close enough. The enemy will start shooting at you!:o

is it a side scroller? or is it like a top view rpg type thing… or is it like an up and down scroller… that depends on the distance you gotta check… if its just the x, just the y, or the x and y…

if its side scroller do

distance = Math.abs(guyX - badguX);

if its top scroller do

distance = Math.abs(guyY - badguyY);

and if its like anywhere on the stage its the distance formula (thanks geometry) hehe * had to look this up btw… didnt remember from last year haha *

Dude, I think you may be a bit ambitious. Not to put you down because of age, but you haven’t even learned geometry and physics yet which is what you need to know in a situation like this. You will also have the know about x and y coords and mathematical equations to determine distance and such.

You at least have to have a basic knowledge of whats going on and why before you can do this project.

ya… i havent even taken physics yet… im in chem 2 (for some stupid reason)… i shoulda took physics this year but im takin it next year… anyway i rememberd that formula from geometry last year… so i hope it helps you out man…

o ya… Math. just calls math functions… it allows you to do powers, square roots, trig stuff (sine, cosine, tangent), rounding off, absolute value… and more! (sound like an advertisement?) haha…

actionscript is sorta hard to learn at first too… im pretty much self taught from tutorials(from here) and this forum… cuz my multimedia 1 class just taught about tweens and shape morphs…but anyway my learning is off the subject… and i think sbeener and ilyas and flex and other people smarter than me would be the ones to ask for help…

o ya for the side and top scrollers im not sure if the math.abs() is necessary… thats just so you dont get a negative answer in case you wanted to check a positive range

Creating engaging and entertaining content for designers and developers since 1998.