Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Flash RPG: Make an Enemy AI

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,907
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 3, 2009

YES I KNOW I NEED A NEW MIC, PLEASE DO NOT COMMENT TELLING ME THAT!!!

CODE:
put in char and enemy:

****IN ENEMY, TAKE OUT THE "Key.isDown(UP)" FUNCTION****

****MAKE SURE TO TURN THE "GREATER & LESS THAN" WORDS INTO THE ACTUAL SYMBOLS.****


onClipEvent(load) {
falling=false;
hitting=false;
gravity=10;
speed=6;
jump=0;
jumping=false;
}
onClipEvent(enterFrame) {
if(!_root.ground.hitTest(this._x, this._y, true) && !jumping) {
_y+=gravity;
gravity=10;
falling=true;
}
if(Key.isDown(Key.UP) && jumping==false) {
jumping=true;
}
if(jumping) {
this.gotoAndStop("jump")
this._y-=jump;
jump-=.7;
if(jump LESS THAN 0) {
falling=true;
}
if(jump LESS THAN -15) {
jump=-15;
}
}
if(_root.ground.hitTest(this._x, this._y, true) && falling) {
jump=12;
jumping=false;
falling=false;
}
}

ADD CODE TO ENEMY:

onClipEvent(enterFrame){
if (_root.char._y LESS THAN _root.enemy._y) {
jumping=true;
}else{
jumping=false;
}
}
onClipEvent(load){
speed=5;
}
onClipEvent(enterFrame){
if (_root.char._x LESS THAN _root.enemy._x) {
_x-=speed;
}
if (_root.char._x GREATER THAN _root.enemy._x) {
_x+=speed;
}
}

Category:

Gaming

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (PivotyPivoty)

  • This don´t work argh!! but it´s cool, I would like to do that in a game...

  • what do you mean it doesn't work? if you follow everything i do, you WILL get it.

Top Comments

  • You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. You need a new mic. BWAHAHAHAHAHA! I'm terrible. >:D
  • damn i cant listen to it. maybe tut is good but you could type instead of talking :>

see all

All Comments (33)

Sign In or Sign Up now to post a comment!
  • its a cool sounds, like youre on a radio or talking threw a helmet

  • can you convert the codes in action script 3.0 ??

  • since you have a new mic could you remake this tutorial please?

  • You should get the video and re record the sound or just remove all the sound and put in captions. I know every has been moaning just that you cat hear anything.

  • This is nice, Flasn tutorials over CB radio :~)

  • i love the sound of the mic it sounds like a walkie talkie

  • thanks!!!!!!

  • this doesnt work cose the enemy keeps running away from my char not going towards it!

  • hey pivoty..why dont you remake this vid but with your new mic? not critisisim.. just an idea

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more