Yoh, I’m new here, and I’ve had Adobe Flash CS3 for…4 weeks, I think. Anyways, working on a game and, as all the sites and tutorials say, the hardest part is AI. Anyways, I’ve decided to take a different approach to it, one noted in the Megaman Zero games. Anyways, here’s my code.
onClipEvent(enterFrame){
tx = this._x; //The enemy’s x
mx = _root.char._x; // the main character’s x
rx = tx - mx; // The enemy’s x minus the character’s x
}
onClipEvent (enterFrame) {
tx = mx - 10; //When this frame appears, go to the Main character’s x and stay there.
}
What I wanted that to do was make the frame that it was on AND the frames after it to move where ever the main character is (char) -10 on the x axis. But for whatever reason, it doesn’t work.
Thanks in Advance