Macromedia Flash CS3 Tutorial 3: Making the character attack and making an enemy

Loading...

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

Uploaded by on Feb 6, 2009

Here is the code you need to put on the character:
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
_x += 10;
this.gotoAndStop("right");
}
else if(Key.isDown(Key.LEFT)){
_x -= 10;
this.gotoAndStop("left");
}
else if(Key.isDown(Key.SPACE)){
this.gotoAndStop("attack");
} else {
gotoAndStop("still");
}
}

And here is the code for the enemy:
onClipEvent(enterFrame){
if(_root.char.wk.hitTest(this)){
unloadMovie(this);
}
}

Thanks for watching!!
Comment,
Rate,
Subscribe,

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (VampieGames)

  • Wicked thanks. I made it so you hit the enemy 3 times to kill him with a different animation at each stage of the death.

  • @rixemberg nice work mate! send me a link to your game? :P

  • cool tutorial i think i put the rong names in the instance boxes could you tell me what they are suppost to be

  • chart for char enemy for enemy and wk on the weapon

see all

All Comments (31)

Sign In or Sign Up now to post a comment!
  • could you make the same tutorial with actionscript 3?

  • I'm gonna get a few levels done first then I'll send you a link mate, just can't figure out how to link the scenes.

  • Nice tutorial! ;)

    But it would look better if the character there would be an animation, when you hit/kill the enemy. So that it would fall over or something.

  • I want the download link

  • i can't hear a shit

  • I am working on my first succesful thing in flash so thx

  • how do you make eyes that follow mouse

  • whats the wepons instance name...i didn't catch it

  • wish it was for ASII

  • It's the same program but with added stuff. Adobe bought macromedia about a few years ago.

  • the program is Adobe flash CS3, not Macromedia flash CS3. nice tut anyway

  • When I duplicate Fred to make the enemy, it copies everything (also the actionscript and frames in Fred itselfs).

    How can i just duplicate the image of Fred?

    Awsome tutorials btw...

  • THANX i took this and put it to the next level, when you attack you can make the enemy's hp bar go down! it's chill

  • try using keyup instead of keydown.

    onClipEvent (keyUp) {

    if (Key.getCode() == Key.SPACE) {

    this.gotoAndStop("attack");

    } else {

    gotoAndStop("still");

    }

    }

  • Whem my guy attacks, the enemy doesn't die

    I'm thinking it might have something to do with the instance names and that I may have put one somewhere where it shouldn"t be, but I don't know

    Can ya help?

  • hey i was wondering if you could maybe do a tutorial on how to attack in two directions instead of one, like this tutorial teaches how to attack someone in front of you but i need to kno how to attack in front and in back but without using more than one button to do it, like to attack the way your turned is what im trying to say.

  • use xscale!

  • just do the same but make the attack animation on the left side.

  • can u do a tut there the enemy move him self??

  • how come my char just keep moving and attacking (looping) on its own?

  • nice tutorials.... but how do you make the character attack from the left side?

  • it dosen't work! It can't attack or move

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