Best viewed in Firefox

Awesty Productions

Making a Fight Game

October 15th, 2006 by awesty

In this tutorial you will learn how to make a fight game in flash. I will only be teaching you how to set up the character and the actionscript, not how to animate the character.

Click Here to see the final product.

This tutorial will be a whole lot easier if you have already taken my Moving MovieClips with the arrow keys, Making walls with hitTests and Making a health system tutorials since alot of the script used in those will be used in this tutorial so I won’t go into as much detail with them as I might with the rest of the script.

First of all, you need to make your character. You need to make a movieclip of him standing still, walking/runnning and punching/kicking/attacking.
When you have got all of these I want you to put them all into one single movieclip. With the standing movieclip on the first frame, the walking/running on the second and the attacking on the third. Give this MovieClip an instance name of ‘man’. It is case sensitive

Select the first frame of this newly created movieclip and put this action on it:

stop();

That just means ‘Stop on this frame’. Repeat this with the other two frames. That is so the movieclip doesn’t loop.

Now return to the main timeline and click on you ‘man’ movieclip and put these actions on it.

onClipEvent(load){
    fight = false;
}
onClipEvent(enterFrame){
    if(fight == false){
        if(Key.isDown(Key.LEFT) && fight != true){
            this._x -= 4;
            this._xscale = -100;
            this.gotoAndStop(2);
        }else if(Key.isDown(Key.RIGHT) && fight != true){
            this._x += 4;
            this._xscale = 100;
            this.gotoAndStop(2);
        }else{
            this.gotoAndStop(1);
        }
    }
         if(Key.isDown(Key.SPACE)){
            this.gotoAndStop(3);
            fight = true;
        }
        if(this._currentframe == 1){
            fight = false;         
        }   
}
 

That is the main peice of code you need for this tutorial, but you are not done yet. If you test your movie now (Ctrl+Enter) there will still be some bugs which we will fix after I finish explaining the code you just got.

onClipEvent(load){
    fight = false;
}

That means when this movieclip loads, the variable fight is equal to false. This variable is used to see whether the ‘man’ movieclip is attacking or not, so he doesn’t walk and attack at the same time. If you make him jump this is handy also because otherwise if you attack in mid-air he will freeze and stop jumping.

onClipEvent(enterFrame){
    if(fight == false){
</blockquote>
<p>Every frame, if the variable fight is equal to false
</p>
<blockquote>if(Key.isDown(Key.LEFT) && fight != true){
            this._x -= 4;
            this._xscale = -100;
            this.gotoAndStop(2);

I the left arrow key is down and (&&) fight is NOT equal to (! is the symbol for not in most coding languages, so != means not equal to) true, this _x coordinate decreases by 4 pixels (therefor it moves left), this _xscale equals -100 (an _xscale of 100 is normal width, one of 50 is half its normal width, one of -100 is its normal width but facing the other way, so then ‘man’ faces left when he walks left), this go to and stop on frame number 2 which should be the walking frame.

}else if(Key.isDown(Key.RIGHT) && fight != true){
            this._x += 4;
            this._xscale = 100;
            this.gotoAndStop(2);

The above code (it is the same as this but for left instead of right) won’t happen unless this code is happening. The rest of the code you should recognise from before, some numbers are just changed around and LEFT is RIGHT.

}else{
            this.gotoAndStop(1);
        }

If the two above code aren’t running, this can go to and stop on frame number 1, the idle/standing still frame.

if(Key.isDown(Key.SPACE)){
            this.gotoAndStop(3);
            fight = true;
        }

If the space bar in down, this can go to and stop on frame number 3 (the attacking frame) and fight is equal to true.

if(this._currentframe == 1){
            fight = false;         
        }

If this movieclips is currently on frame one (the idle frame), fight equals false.

Now to fix that bug I talked about earlier. If you test your movie (Ctrl+Enter) after you attack you might not be able to walk or you attack might be looping or something might not be right. To fix this double click on your ‘man’ movieclip to enter it. There should now be three frames where you put your idle, walking and attacking movieclips. Click on the third frame (which should have you attacking movieclip on it, if not click on the frame it is on) and double click on the attacking movieclip. Now make a new layer and make a keyframe on the last frame and put this code on it.

_root.man.gotoAndStop(1);

Now when your man has finished attacking he will go back to his idle stance. If you test your movie now (Ctrl+Enter) It should be working fine.

Now to make your enemy. For this tutorial it is just going to be a punching bag because otherwise I would have to go into AI (Artificial Intelligence) which is more advanced.
Once you have finish making your punching bag convert it to a movieclip (F8) and give it an instance name of ‘enemy’.
Now we are going to make the health system. If you have trouble with this have a look at my Making a health system tutorial. Make a rectangle for your health bar and convert it to a movieclip (F8). Now make some dynamic text above the health bar and give it a variable name of ‘hp’.

Click on the first frame of you movie on the main timeline, and put these actions on it.

stop();
_root.hp = 100;

You might have already put stop(); there, so if you have don’t put it there agian. All that means is stop on this frame and the dynamic text ‘hp’ is equal to 100.

Now select the Hp bar and give it this code.

onClipEvent(enterFrame){
this._xscale = _root.hp;
if(_root.hp <= 0){
_root.hp = 0;
_root.gotoAndStop(2);
}
}

You should have already done that in my health tutorial, but I will breifly go over it again. All it means is every time this frame is entered, this _xscale is equal to _root.hp (the dynamic text). I explained _xscale before so if you forgot you should read it again. The next part says if _root.hp (the dynamic text) is equal to or less than 0, it equals 0 (so there are no negative numbers) and go to and stop on frame number 2 on the main timeline. Later on we will put a frame there, but we still need to finish the health system.

Now go back inside the attacking movieclip, and on the actions layer make a keyframe where he stops attacking (if you already made a keyframe there before, there is no need to do this). On that keyframe put this script.

if(this.hitTest(_root.enemy)){
_root.hp -= (random(5)+1);
}

If this is on the same frame you put actions on before just put these ones underneath the other ones. All the means is if this is touching the punching bag, the dynamic text will decrease by a random number from 0-4 +1.

If you test your movie (Ctrl+Enter) now you should see a fully functioning game. But we still have to add a 2nd frame. To do this just click on the second frame and hit F6 to make a keyframe. Now just put a message like “You killed it” or something along those lines, and maybe a “Play Again?” button. If you dont know how to make buttons have a look at my Button tutorial.

You should now have something similar to this.

I am glad to say, this is the end of the tutorial since I have been sitting here ALL DAY writing just for you guys :P .

For more tutorials click here.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • del.icio.us
  • digg
  • Furl
  • MyShare
  • NewsVine
  • Netscape
  • Reddit
  • Simpy
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

RSS feed | Trackback URI

539 Comments »

Comment by Goot
2006-10-16 02:57:37

(Again,) Pretty good!

A few issues - you might want to prevent the guy from walking off the screen. You can either stop him at the edge or (even cooler) make a wraparound effect (which is a lot harder as well).

Try adding this to the onClipEvent(enterFrame) statement:
this._x = Math.max(Math.min(this._x,Stage.width-this._width),0);
(which assumes the guy’s registration point is top-left)

Comment by Kevin Subscribed to comments via email
2007-06-08 06:26:07

can you help me make the hero not to lose health when he walks at the punching bag or as in my case its venom.

Comment by Kevin Subscribed to comments via email
2007-06-08 06:35:18

If you use animated gifs does it make any different.

Email me at kev_branco@hotmail.com to send me some tips

 
 
Comment by OverAchiever
2008-05-18 15:56:10

This tutorial is awesome, especially with every other tutorial, I made a 2 player fighting game with this tutorial, awesome! XD

 
 
Comment by Sean
2006-10-23 11:08:54

I got stuck at _root.man.gotoAndStop(1);

i put it down, but it still loops the attack!
Help!

Comment by tyler Subscribed to comments via email
2007-09-08 05:51:22

You just put stop on all the action frames it will stop them so non replay.

Comment by T&B inc Subscribed to comments via email
2008-08-10 15:02:06

that does not work. The attack loops even though you put the _roor.man.gotoAndStop(1);

 
Comment by T&B inc Subscribed to comments via email
2008-10-17 10:40:33

i did.. and it wont work

Comment by llLeonll Subscribed to comments via email
2009-02-22 15:58:45

uhh on the end of your attack frame put this in the actions slot

gotoAndStop(1);

 
 
 
Comment by zorg Subscribed to comments via email
2008-02-03 20:44:28

same

 
 
Comment by awesty
2006-10-23 16:42:52

Make sure you movieclip has an instance name of man. It is case sensitive.

Comment by Marcus Subscribed to comments via email
2007-07-03 03:01:32

hi when i play my attack loops even with the _root.man.gotoAndStop(1) in it i need help!!!!!

Comment by ryan Subscribed to comments via email
2008-05-30 06:06:33

yea me 2
i’m not that new to flash but have no experience w/actionscript

i put stops on all the frames i needed and the goto and stop thing in the right place

i has no clu

 
Comment by Mr. McGoodlookin Subscribed to comments via email
2008-10-19 08:11:39

hey Marcus. when u go into the attcking movie clip did u clike make new layer? if u didint do that. then go the the last frame of ur seconed layer and right clikc it and hit intert keyframe. Then click actions for that keyframe THEN put in _root.man.gotoAndStop(1)

 
 
 
Comment by Chris
2006-10-26 12:02:48

This is a great tutorial, but i have found that

_root.man.gotoAndStop(1);
if(this.hitTest(_root.enemy)){
_root.hp -= (random(5) 1);
}

should be:

if(this.hitTest(_root.enemy)){
_root.hp -= (random(5) 1);
}
_root.man.gotoAndStop(1);

since it reads scripts top to bottom it goes to frame 1 before it calculates “damage”

at least that is how it worked on mine

 
Comment by awesty
2006-10-26 16:19:24

Yea, you are right. But that is how I did the code in mine so it worked fine :S

 
Comment by Sam Castagna
2006-10-27 08:28:34

Hey im sam im working on an point and click adventure game about my home town. its called welcome 2 northside. im using flash and im kinda new to gaming. can u say how to make a point and click adventure game. im having some difficultys.. if you dont know what kind of game im talking about go to…

http://uploads.ungrounded.net/.....tle=Johnny Rocketfingers 2&date=1161835200&quality=b&uj=0&w=500&h=375

 
Comment by awesty
2006-10-27 11:59:16

I might do a tuturial on it sometime, but for now I think you should have a look at my buttons tutorial. You could make a similar but more basic game from what you learn from it.

http://www.awestyproductions.c.....-in-flash/

 
Comment by Hoosha
2006-10-28 06:59:11

Can someone upload the fla version of this?

 
Comment by Tom
2006-10-28 07:11:27

My dynamic text bar doesn’t work, i put all the codes in but when i’m testing it, nothing appears.
the bar goes down though.

 
Comment by hoosha
2006-10-28 07:17:11

1) i cant seem to fix the error where the attack gets stuck, i dont get what you mean where you say put this at the end of the keyframe.

2) how do you change the frame when the hp is 0??

3)is there a way that if the man toutches the punchbag he looses hp?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom i can help you

Comment by Kevin Subscribed to comments via email
2007-06-08 06:16:47

yo my name is kev and im almost finished a fighting game im working on where venom and spiderman fight each other. I have them attacking each other but every time they touch each other they lose health.

Can you help me!

 
 
Comment by @ hoosha
2006-10-28 09:54:19

Hoosha, to fix number 1, in the man movieclip, and then in the attack movieclip, at the end of the attack sequence/animation, on another layer (make one IN the attack sequence). Make it as long as the animation, and then, at the end, make it a keyframe.

Then add the code:
_root.man.gotoAndStop(1);

That probably doesn\’t make any sense, so here is a picture.

Notice how in the picture I am in my man movieclip, then the attack animation movieclip, and on the last frame.

—————————
Problem 2

On your health movie clip, you should have the coding:

onClipEvent(enterFrame){
this._xscale= _root.hpBar;
if(_root.hpBar

 
Comment by @ hoosha
2006-10-28 10:03:00

Damn character limit, email me at “kurt.single@gmail.com” and I’ll resolve this.

And the code for Problem 2 is:

onClipEvent(enterFrame){
this._xscale= _root.hpBar;
if(_root.hpBar

 
Comment by awesty
2006-10-28 10:26:53

@Hoosha: No, otherwise people will download it and say they did it when they didn’t.

@Tom: If the bar is going down it must be working. You might have the text set to white or whatever the background color is so it appears not to be there ;) .

@hoosha: Do you have switch personalaties or is there two of you?
If you are having trouble email me at admin[@]awestyproductions[.]com. If you want the character to lose health when it touches the punching bag take THIS TUTORIAL.

 
Comment by dan
2006-10-29 05:53:13

this is so cool

 
Comment by awesty
2006-10-29 09:59:50

Guys, when you are trying to write:

if(_root.hp <= 0){

It isn’t working because it thinks < is trying to make a new HTML tag, so use this code:

& l t ;

Without the spaces.

 
Comment by Alejo
2006-10-30 09:12:52

Wow im a very new noob and this tutorial helped me a lot thanks… In other sites they doesn’t explain so well like here

 
Comment by Darin
2006-10-30 15:56:32

NICE it really helped me all this searching paid off ^^ Btw my email is mcdonalddarin@yahoo.com could you send me a email on wat to do to make them enemy attack you i making an naruto fighting game and i also wat him to be able to make him use justsu wen he wants can u help

 
Comment by awesty
2006-10-30 16:31:04

@Darin: I will probably make a part 2 to this tutorial, which will include jumping and the enemy will be able to think for itself… sort of. :P

 
Comment by lufuno
2006-10-30 18:43:15

it will taken me about a day to figure

 
Comment by Frodo
2006-10-31 23:06:54

Hi I was having trouble at the very start
(new to flash!), making my characters!

With the men are you ment to use tweens between the different states?

 
Comment by Justin
2006-11-02 09:51:57

THIS HELPED ME ALOT!

Thank you so very much ^_^!

 
Comment by Kieran
2006-11-02 18:48:57

How do you make your walking symbol?
can u upload just the walking *.fla file?
plz

 
Comment by timmy
2006-11-03 15:01:03

How can u make the first part the picture thing..

 
Comment by awesty
2006-11-03 15:06:46

Sorry, but you will that yourself. This tutorial is for the actionscript and how to set it up only.

 
Comment by timmy
2006-11-03 15:25:07

ok, anyways thanks

 
Comment by Tom
2006-11-04 20:31:28

I’m making a fighting game and it’s two player, i can’t get player 2 move but i can get it to attack with TAB to attack. But what do i put when i want to make him move left - A. and move right - D.?
Any help would be great, thank.

Comment by chikonator Subscribed to comments via email
2008-01-24 08:49:08

the code is

onClipEvent(enterFrame){
if(fight == false){
if(Key.isDown(65) && fight != true){
this._x -= 4;
this._xscale = -100;
this.gotoAndStop(2);
}else if(Key.isDown(68)&& fight != true){
this._x += 4;
this._xscale = 100;
this.gotoAndStop(2);
}else{
this.gotoAndStop(1);
}
}
if(Key.isDown(Key.CONTROL)){
this.gotoAndStop(3);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
if(Key.isDown(Key.TAB)){
this.gotoAndStop(4);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
if(Key.isDown(Key.ESCAPE)){
this.gotoAndStop(5);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}

 
 
Comment by Nytrus
2006-11-04 23:41:28

I also got stuck at _root.man.gotoAndStop(1);. My man’s name is right and I’ve put the script on a new layer on the last frame in the attacking movie clip. What do I do?

 
Comment by Nytrus
2006-11-04 23:48:50

I just solved this problem by clicking on the instance of the man and typing his name in the properties box to the left under the drop down meu that read ‘movie clip’ Silly me!

 
Comment by Artechx
2006-11-05 00:12:54

You really did a wonderful job. It made me inspire to continue learning flash which i stop couple of years ago. Do you have a website where your tutorials and samples can be found. Tnx you!

 
Comment by awesty
2006-11-05 10:06:25

@Tom: For keys other than the arrow keys, instead of doing something like Key.isDown(Key.LEFT) you change it to this:

Key.isDown(KeyCode);

Since the key ‘W’ key code is 87 you would put

Key.isDown(87);

You can find a full list of key codes here:
http://www.awestyproductions.com/images/keycode.txt

@Artechx: You are on it right now. To see a full list of tutorial go here:
http://www.awestyproductions.com/tutorials/

 
Comment by Tom
2006-11-05 20:00:37

Thanks =)

Do you know how to make items break, say i attacked a box and it broke?

 
Comment by Tom
2006-11-05 21:15:29

Thanks for the help earlier.

I need help with my health, when it goes down to 0, it sends me to the main menu on scene 1.
I want it to send me too Scene 2, Frame 3.
How do i write it, because this didn’t work:

_root.gotoAndStop(”Scene 2″, “3″);

Any help would be great, thanks. =D

 
Comment by Rick
2006-11-06 09:40:52

Thanks, this taught me alot of useful action scripting in very short time.
But I’d also like to know how to make the punching bag (or box in my case) break.

Furthermore, lets say I wanted a wall and when the punchingbag’s hp reaches 0 the wall will either disappear or move away allowing the character to move on. How would I go about doing that?

 
Comment by Rick
2006-11-06 09:43:05

Also Sam, Im really interested in that point and click adventure game you were talking about. Can you make a tutorial when your done? Also I went to see the web site you linked and it was down, could just be my browser.

 
Comment by Reg
2006-11-06 11:51:06

Thanks a lot! Rick said everything I was going to say

 
Comment by awesty
2006-11-06 15:40:25

@Tom: You only need to put strings (A word, like Scene 2) in quotation marks (”"), not integers (a number). So it would be:

_root.gotoAndStop(”Scene 2″, 3);

About the breaking items, I will do that in another tutorial.

@Rick: Read the last part of what I wrote for tom and I will try and make a point and click tutorial.

Also try this link:

http://www.newgrounds.com/portal/view/310635

 
Comment by Tom
2006-11-07 02:09:32

Okay, Thanks. =]

 
Comment by Tom
2006-11-07 03:36:34

I’m making a AI computer chacracter but when it comes towards me it doesn’t walk, i made it in a movieclip like the way i would make a player one character, i’ve used this coding;
if(rxerx 40)
this._x =2;
_.root.boltwalk.play();
}
if(_root.man.hitTest(this))
_root.boltattack.play();
}
but he just slides and when it says; “_root.boltattack.play();”
It doesn’t do anything.

 
Comment by awesty
2006-11-07 10:44:55

Well set him up like how we did to the character in this tutorial, and instead of saying _root.boltwalk.play(); do this.gotoAndStop(2); which would have the walking MC on it, and do the same for the attack.

 
Comment by Bob
2006-11-07 10:57:41

Could you give me a simple script one enemy AI in a fighting game. Just to have him randomly attack, and advance to attack?

 
Comment by awesty
2006-11-07 19:41:04

I will try to do a tutorial before the weekend.

 
Comment by Bob
2006-11-08 02:07:51

Sweet! Thanks you so much!!

 
Comment by Tom
2006-11-08 03:36:38

My man now attacks but doesn’t walk, can you help me with the coding for my enemie:

onClipEvent(enterFrame)
{
distance=600
rx=_root.man._x
ry=_root.man._y
erx=_root.bolt._x
ery=_root.bolt._y
if (Math.sqrt( (rx-erx)*(rx-erx) (ry-ery)*(ry-ery))erx 40)
this._x =2;
_.root.bolt.gotoandstop(2);
}
if(_root.man.hitTest(this))
_root.bolt.gotoandstop(3);
}

He doesn’t face right when i run behind him either, what coding do i need to make him do this?

 
Comment by Strangen
2006-11-08 10:23:40

when i try to replace the > in
if(_root.hp

 
Comment by Strangen
2006-11-08 10:26:26

with & l t;(i dont no y my last post got cut off) i keep getting an error

 
Comment by Billy
2006-11-08 14:58:31

Im new to flash and I wanted to know… what do you mean by: (in brakets)

You need to make a movieclip of him standing still, walking/runnning and punching/kicking/attacking.
When you have got all of these I want you to put them all into one ((single movieclip)). With the standing movieclip ((on the first frame, the walking/running on the second and the attacking on the third.))

 
Comment by awesty
2006-11-08 15:12:13

@Tom: I have seen that code before. :P It is from another tutorial. Anyway, try changing it to this:

onClipEvent(enterFrame){
distance=600;
rx=_root.man._x;
ry=_root.man._y;
erx=_root.bolt._x;
ery=_root.bolt._y;
if(Math.sqrt((rx-erx)*(rx-erx)(ry-ery)*(ry-ery))erx 40){
this._x -= 2;
_root.bolt.gotoandstop(2);
}
if(_root.man.hitTest(this)){
_root.bolt.gotoandstop(3);
}

That might work, but it is untest and I am not sure about that trigg.

@Strangen: I think you might need to be a registered member to do that, so just replace < with [ or something.

@Billy: I would recommend taking some more basic tutorials first.

 
Comment by BoomBoombox
2006-11-08 16:23:13

:’( Am Super |\|008 at this and ive been staying up all night for like weeks trying to figure this out :(:(:( but how do i make it so that it goes to another frame when my enemy has 0 hp??

 
Comment by awesty
2006-11-08 16:38:16

It says that in the tutorial does it not?

…You should have already done that in my health tutorial, but I will breifly go over it again. All it means is every time this frame is entered, this _xscale is equal to _root.hp (the dynamic text). I explained _xscale before so if you forgot you should read it again. The next part says if _root.hp (the dynamic text) is equal to or less than 0, it equals 0 (so there are no negative numbers) and go to and stop on frame number 2 on the main timeline. Later on we will put a frame there, but we still need to finish the health system…

…But we still have to add a 2nd frame. To do this just click on the second frame and hit F6 to make a keyframe. Now just put a message like “You killed it” or something along those lines, and maybe a “Play Again?” button…

Comment by Izzy Subscribed to comments via email
2007-08-30 12:19:38

im making a birds eye view rpg
and i wanted to learn how to make
him do the walk cycle in all directions thnx for the help…nice tutorial

 
 
Comment by Ghuiado_thenewbieinflash
2006-11-08 17:29:38

It still repeats the Attack even after I put
_root.man.gotoAndStop(1);
is there somthing I missed?

 
Comment by Ghuiado_thenewbieinflash
2006-11-09 02:11:15

@ Hoosha the Picture is gone? do you have another one?

 
Comment by Tom
2006-11-09 06:44:17

Thanks, but it still doesn’t work xD

 
Comment by awesty
2006-11-09 15:32:33

@Ghuiado_thenewbieinflash: Where did you put it?

There was no picture.

@Tom: Just send it to me other wise wait for the AI tutorial ;)
admin[@]awestyproductions[.]com

 
Comment by joey
2006-11-11 14:34:00

hey i was reading this tutorial helped me so much and like others here i was wondering about A.I. and how to make him jump and controll him in the air after he has jumped. So i was wondering how the tutorial is going it would help me so much!
; )

 
Comment by Strangen
2006-11-12 11:47:04

i tried replacing it with [ but im still getting and error

 
Comment by awesty
2006-11-13 16:07:58

No, lol. I meant replace it in the comment because otherwise it cuts off so I can’t see the rest of the error. It will not work if you do it in flash. :P

 
Comment by Tom
2006-11-14 02:21:24

Okay, Thanks :)

 
Comment by onyx
2006-11-15 16:51:37

we took three different animations and put them into one movieclip on three different frames. When I put the code in when he went from standing to walking…. there is a mild gap between the animations…. do you have to place the animations on top of each other put in different frames?

 
Comment by MrMister
2006-11-16 04:23:51

I noticed if you hold space, the character continues to attack. This is inconvenient for quick attack animations. How should I make it so you have to press the key for every attack?

 
Comment by Kieran
2006-11-16 20:00:21

Hey thats the best walking loop ive ever seen!

You should do a tutorial to make it!!!

 
Comment by awesty
2006-11-17 09:44:41

@onyx: Yes, different frames, same spot and make sure the all the frames have stop(); one them.

@MrMister: You would have to change alot of the code which I do not really feel like doing at the moment so all I can suggest is if it is a quick attack make it only take of 1 or something. But for a long attack make it take of 10.

@Keiren: lol, thanks. I might make tut about it, but not now ;)

 
Comment by Onyx
2006-11-17 13:10:58

i had another problem… my animations are really long because of an item in his hand. when i do the _xscale = -100; it jumps way off the spot he should be turning at… How do I turn on a different pivot point. I tried adding new frames with a symbol of the same animation of walking just turned left… but I couldn’t figure out the code…. could you help??? is there an email I can write to for help? (By the way… these tutorials are fantastic!)

 
Comment by Slash
2006-11-18 05:44:52

How would you make it so the MC will only play a motion tween such as “Walking” when the player only presses Key.LEFT, or Key.RIGHT?

 
Comment by macrodia
2006-11-18 05:45:02

Here is what I have created with your Tutorials.
http://img101.imageshack.us/my.....ametq9.swf
:)
Thanks I learned alot of Basic AS!

 
Comment by awesty
2006-11-18 09:53:40

@Onyx: Try changing the registration point. When you make a MC, you can choose the registration point. But afterwards you have to change it manually.
When you double click on your MC and go into your movieclip you should see a little cross, that is the registration point (the pivot point). Move whatever is inside that MC so the registration point it in the center.

@Slash: Is the motion tween in a symbol or on the main timeline?

@macrodia: Nice. That is really cool. If you don’t mind me asking where did you get those sprites from, they are awesome.

 
Comment by Darin
2006-11-18 13:47:20

hey awesty im havin a prob when i move left he goes but then when i push right he come some where out of th right then start running wat do i do

 
Comment by awesty
2006-11-19 09:22:49

I didn\’t understand what you said then. But it sounds like the same problem as onyx.

 
Comment by macrodia
2006-11-19 15:17:30

@awesty: I got the sprites frome http://mslugdb.com/ they had a great collection of metalslug sprites. Only Problem is the site is Defunct now.
But I do have a large collection of them already on my HD.(:

 
Comment by ando
2006-11-19 17:46:37

hey thanks for the tutorial, its awesome and i got everything work, but i got a question.
if i were to change the fire button from SPACE to left mouse click, what would i put instead of
‘if(Key.isDown(Key.SPACE))’

 
Comment by Webber
2006-11-20 10:17:43

how do you combine the 3 MC to 1 MC? lol all the rest i think i will be able to understand.

 
Comment by Darin
2006-11-20 11:52:31

@Webber: all you gotta do is make a movie clip that is your charactercall it whatever then go in your library find it double click and it should be blank insert the 3 movie clips inside(the stand, run attack). thats what i do

 
Comment by awesty
2006-11-20 17:35:41

@macrodia: That sucks. I was looking foward to using them.

@ando: Okay, just remove the attack code and put this after the rest of the code:
onClipEvent(mouseDown){
this.gotoAndStop(3);
fight = true;
}

That should work, but I am not sure since it is untested. Make sure it is after the rest of the code.

@Webber: You need to make 1 MC (Ctrl F8 makes a blank MC), and make 3 frames inside it. On the first frame putting the idle MC, on the second the walking/running MC and on the third put the attack MC. It is kinda hard to explain. Sorry if that doesn’t make much sense.

Whoops, didn’t read Darins, if you don’t understand his try mine.

 
Comment by webber
2006-11-21 01:19:08

k seems to make scense both of yours, besides awesty’s cuz how do you make an object movie in only one frame? or do you meen insert the other mc’s into that frame?

 
Comment by Julian
2006-11-21 01:51:50

I made the game and it didn´t work so good.. When I make the guy walk right he walks, but when I make him turn left he appears like in the other side of the screen, can u help me with that plz? btw, I have another question. When I make him attack it doesn´t stop, and the code u put to fix that mistake didn´t work. If you can help me I would really aprecciate that. Thanks.

 
Comment by awesty
2006-11-21 15:11:04

@webber: Yea, just drag the MC out of the library into that MC. So then you have 3 MCs in one MC.

@Julian: Try changing the registration point. When you make a MC, you can choose the registration point. But afterwards you have to change it manually.
When you double click on your MC and go into your movieclip you should see a little cross, that is the registration point (the pivot point). Move whatever is inside that MC so the registration point it in the center.

With your other problem, make sure you didn’t miss out on any of the code.

Also you can email it to admin[@]awestyproductions[.]com and I will have a look at it. ;)

 
Comment by ando
2006-11-21 18:47:39

it works! thanks so much for your help awesty. i’m using all your tutorials to make myself a cool game :D (i got a 4 month holiday to kill!)

 
Comment by ando
2006-11-22 01:04:00

hey sorry, i got another question, is there any way to change keys from using left and right to using A and D?
thanks

 
Comment by Darin
2006-11-23 03:58:36

Hey Awesty do u have Aim

 
Comment by Tyler
2006-11-23 11:43:40

i have no idea what to do i have one question came some one make me one of these games for me and i’ll learn off that i work better if i have an example

 
Comment by ando
2006-11-23 12:41:28

whoops sorry, it was already posted up top somewhere

 
Comment by awesty
2006-11-23 15:19:12

@Darin: No, but I have msn. sniper_rifle_048[@]hotmail[.]com

@Tyler: First of all do you have flash (Yeah, a stupid question but just in case)? Try doing some easier tutorials first, then get harder.

 
Comment by Julianrocks
2006-11-24 15:27:54

OK. NOTHING WORKS!
It says:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances
onClipEvent(load){

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 4: Clip events are permitted only for movie clip instances
onClipEvent(enterFrame){

Total ActionScript Errors: 2 Reported Errors: 2
I am stuck.
He doesnt move or any thing.

 
Comment by awesty
2006-11-24 15:51:48

It looks like you put the code on the frames instead of the movie clips.

 
Comment by Darin
2006-11-25 05:27:44

Awesty wen are u on msn

 
Comment by Julianrocks
2006-11-25 07:38:34

yay it works…. except when i punch… it loop and i put _root.man.gotoAndStop(1);, still loops… i put it on my punch last frame on top layer….

 
Comment by iAnimate
2006-11-27 02:04:42

Yeah, I have one slight problem.
I done all the animations and movements right, but can’t seem to get the dynamic text or hp bar right as it doesn’t seem to work.

http://img329.imageshack.us/my.php?image=fightgamepracticeerrorbga2.swf
swf file ^

http://denvish.net/ulf/1164557034_Fight game practice Error bar.fla

fla^

tell me what i got wrong, email me at saint.sileighty@gmail.com

 
Comment by awesty
2006-11-27 17:29:57

@Darin: Not much. I am on now, I have started going on more.

@Julianrocks: Thats wierd.

Try putting this on your ‘man’ MC.

if(fight != true && !Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)){
this.gotoAndStop(1);
}

That might work, but it is untested.

@iAnimate: Denvish doesn’t work anymore.

Email it to admin[@]awestyproductions[.]com. ;)

 
Comment by Carson
2006-11-29 12:26:27

How do you put an instant name on your movie clip?
( im slow with these things )

 
Comment by Bryce K :P
2006-11-29 12:29:12

How the heck do u make ur stick figures so perfect im dying to know!!! (Lol) But serouisly I NEED 2 KNOW!! My are lumpy and look like crap…

 
Comment by Bryce K :P
2006-11-29 13:26:20

*SIGH* i read all ur other things and

if(fight != true && !Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)){
this.gotoAndStop(1);
}

doesn’t work… well it kinda does but it loops to my 1st attacking frame and ends there, then everything stops… i tried to modify it but nothing works plz help!!! (But the other parts kick ass) :)

 
Comment by Bryce K :P
2006-11-29 13:28:49

Carson i can answer ur question :)

Open the Properties Inspector and rite below (if you clicked a Movie Clip) Movie Clip it will say >Instance Name

 
Comment by Bryce K :P
2006-11-29 13:35:21

OOO sry i keep posting but I have something that could make ur website better maybe if you put for download ur .fla file so we could look at it and see wut we did wrong :)
or maybe not :P

 
Comment by awesty
2006-11-29 15:44:29

I don’t let download the .fla for this tutorial because otherwise people would just download the .fla and not do the tut and say they made it.

If you have any trouble just email me at admin[@]awestyproductions[.]com.

Try using the line tool for you stick figures.

 
Comment by xXx
2006-11-29 17:36:10

yeah quite helpful bUt how do i make a movie clip

 
Comment by Bryce K :P
2006-11-30 00:39:34

to make a movie clip press Insert, New Symbol, Movie Clip

 
Comment by Bryce K :P
2006-11-30 01:11:21

awesty i emailed you but it says that this email does not exsit so… could you e-mail me with some help? i need help with the _root.man.gotoAndStop(1); thing (it won’t work)

 
Comment by awesty
2006-11-30 11:14:34

@xXx: You can also just select something, hit F8 and it will become a movieclip.

@Bryce: I got your email and replied, did you take out the ‘[’? They were just put there for spam reasons.

 
Comment by Bryce K :P
2006-12-01 10:42:53

yah i did… ._.

 
Comment by Bryce K :P
2006-12-01 10:45:04

umm.. i didnt get an e-mail from u Awesty, (and u know wuts weird were i live today is November 29,2006 :)

 
Comment by awesty
2006-12-01 16:28:47

Well it must’ve been someone else.

About the dates, it isn’t the same everyone in the world, I can’t please everyone.

 
Comment by Onyx
2006-12-01 18:07:38

i figured out the registration point finally… now I have 2 players on 1 screen fighting… but I don’t know how to make their weapons only hit once. I made a new MC (a little line) and put it in a new layer under the tip of the attack animation’s weapon and wrote the script for a hitTest with that point and the other player…. but it does random damage (0-5) every second that the weapon is touching the other player?????

 
Comment by onyx
2006-12-01 18:09:05

oh yeah thank you SOOOO much for all of your help!
(I notice you answer a lot of the same questions over and over!)

 
Comment by awesty
2006-12-01 22:01:02

It actually does it every frame. If you frame rate is 30, then it will happen 30 times a second if it is touching for that long.

 
Comment by Bryce K :P
2006-12-02 00:48:30

lol oh well >_

 
Comment by Bryce K :P
2006-12-02 00:50:22

oh i furgot to tell u ur Links dont work (maybe its just me)

 
Comment by awesty
2006-12-02 09:59:08

Thats weird. They all work for me.

 
Comment by Justin
2006-12-02 11:34:31

How do you make an animated thing (like the walking/running and attack) a MovieClip? It says you can only make one of the frames a MovieClip. Any help? Part:

“First of all, you need to make your character. You need to make a movieclip of him standing still, walking/runnning and punching/kicking/attacking.
When you have got all of these I want you to put them all into one single movieclip. With the standing movieclip on the first frame, the walking/running on the second and the attacking on the third. Give this MovieClip an instance name of ‘man’. It is case sensitive”

 
Comment by Bryce K :P
2006-12-02 11:36:43

ahh lol i fianlly found out how to work this tutorial (sry i blamed u it was me :P) but how ever i am stuck on the HealthBar there are no Actionscript errors but the Health wont go down, i think it cause i put the ActionScript on the wrong Frame wut do u mean by action frame? (I have done ur Health Tutorial and it works there)

 
Comment by Bryce K :P
2006-12-02 12:08:12

lol nvm j/k I furgot to give the enemy an instance name :)

 
Comment by awesty
2006-12-02 16:53:37

@Justin: You make 3 separate movieclips, each can be as many frames as you like, and then you put each movieclip into one, with the idle MC on the first frame, walking on the second and attacking on the third.

 
Comment by Bryce K :P
2006-12-03 02:12:30

Im making a fight game (duh) but like how do u make the screen move as ur charecter does like in EX: Metroid (the old 2-D ones)

 
Comment by Bryce K :P
2006-12-03 02:13:40

also using sound how do u make it louder? ’cause its to quite but i dont no how to make it louder cause my backround music is to loud

 
Comment by Bryce K :P
2006-12-03 09:54:06

nvm i figured out how to make sound more quite but i still need help on the question above it ty!

 
Comment by =ßoC= Darker
2006-12-03 12:44:53

Can someone please give me a link to a RPG tutorial i am (very, very) quite young but into gameing. I love RPG but i want to get a tutorial that has the full tutorial. That is not my main focus my dream game is a platformer so i will accept good platformer tutorials.

Help Needed, with much apreciation

Darker

 
Comment by Justin
2006-12-03 14:10:33

Okay, got that part. But, how do you put one of the movieclips that have more than one frame into just one frame?

 
Comment by awesty
2006-12-03 17:28:51

@Bryce K: Instead of making your guy move, make the background move. Or make you guy and a scripted camera move without the background moving.

@=BoC= Darker:

RPG tutorial:
http://www.awestyproductions.com/tutorials/flash-tutorials/making-an-rpg-type-game/

Platform tutorial:
http://www.awestyproductions.c.....m-jumping/

@Justin:

Okay, I can’t really make it much clear. You have your 3 movielclips right. Make another one, double click on it and on the first frame, drag the idle MC from the library onto the stage, the same with the others.

 
Comment by =ßoC= Darker
2006-12-04 01:29:51

Thank you awsety.

 
Comment by =ßoC= Darker
2006-12-04 02:12:10

Sorry for double posting but does anyone have a tut or actionscript for making a button that leads to a new frame in a movieclip from the main scene1

 
Comment by Daniel
2006-12-04 05:13:04

Please help me. I did the whole tutorial but wheni hit the screen anywhere the bar goes down, can you tell me how to make the bar go down only if he hits the bag?
Thank you.

 
Comment by awesty
2006-12-04 12:16:55

@=BoC=: http://www.awestyproductions.c.....-in-flash/

@Daniel: That is weird. Which version of flash are you using?

 
Comment by Daniel
2006-12-05 09:47:39

I am using macromedia flash 8.

 
Comment by Daniel
2006-12-05 09:58:20

Sorry for posting again. What exactly is a syntax error?

 
Comment by awesty
2006-12-05 16:07:58

A syntax error just means it doesn’t make sense, or something is missing or something is wrong with the code in general.

 
Comment by Daniel
2006-12-06 10:25:51

Thank you awesty. In some comments, in some other tut, you said you learn this in school. Is that a special school or just a class?

 
Comment by awesty
2006-12-07 15:29:13

umm… I did? I most of everything I know about coding off the internet. Just doing tutorials. For actionscript the Flash Help (F1) can be a big help.

 
Comment by Daniel
2006-12-08 09:56:17

You made a tut on moving movieclips and makeing a smiple fighting game and health bars. You also made a tut on how to make jump platforms. But can you make a tut on particularly jumping, because i know how to make my character jump up and not up and sideways same time.

 
Comment by Bryce K :P
2006-12-08 12:26:35

Wut does this mean???

Statement must appear within on/onClipEvent handler

 
Comment by Bryce K :P
2006-12-08 12:29:50

This is my formula wut is wrong with it?

onClipEvent(load){
fight = false;
}
onClipEvent(enterFrame){
}
if(fight == false){
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(2);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}

P.S. I don’t want him to move

 
Comment by Stringy
2006-12-08 14:25:32

hey, to all those who might be having trouble with the

_root.man.gotoAndStop(1);

I found that if your man movie clip is named man_mc, then the line should be:

_root.man_mc.gotoAndStop(1);

it corrected the animation problem where the attack animation kept looping.

 
Comment by awesty
2006-12-08 16:58:10

@Daniel: What do you mean? Platform jumping is for jumping itself, I had to add other stuff to it so it would work. You need to be able to move and have something to land on.

@Bryce K: You have an extra bracket. Change it to this:

onClipEvent(load){
fight = false;
}
onClipEvent(enterFrame){
//You had a bracket here.
if(fight == false){
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(2);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}

 
Comment by Daniel
2006-12-09 05:53:21

Oh ok thanks, i was confused because you usually explain after the code, but here you wrote the explanation right after and i was confused with too many things.

 
Comment by Bryce K :P
2006-12-09 08:16:22

still doesnt work

 
Comment by Bryce K :P
2006-12-09 08:19:46

i used ur formula and it says this

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 6: Statement must appear within on/onClipEvent handler
if(fight = false){

also how do u make a scripted camera?

 
Comment by Caleb
2006-12-09 08:34:35

root.man_mc.gotoAndStop(1); still doesnt work… if u find a solution plz email me… thx

By the way gj

-Caleb

 
Comment by awesty
2006-12-09 09:48:01

@Bryce K: Try this:

onClipEvent(load){
fight = false;
}
onClipEvent(enterFrame){
//You had a bracket here.
if(fight == false){
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(2);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}

About the scripted camera, I might try and make a tutorial. But in the mean time you could try finding and downloading V-cam. It is a free to download scripted camera.

@Caleb: What is the instance name of your MC. It is \’man\’ right?

 
Comment by ares
2006-12-09 09:50:38

Hey great tutorials really explains alot :D

 
Comment by Pamela
2006-12-09 10:19:28

Thankyou so much! I am trying to make a fighting game so I can upload it onto deviantART and this tutorial (and some of the comments) have helped me, alot! Thankyou!

 
Comment by Hats
2006-12-11 10:36:21

Hey, quick question… I got all that working and played about getting it going from frame to frame as ya beat different enemies but I wanna make something where it starts with two or more enemies on the screen and both need to be beaten before it lets ya move on. How would I do this?

Many thanks

 
Comment by Mike F.
2006-12-11 11:24:26

Hi, _root.man.gotoAndStop(1); still doesn;t work! I placed it in the last keyframe on a different layer in the “man” movieclip. It just keeps looping. Please help!

 
Comment by Mike F.
2006-12-11 12:25:13

Fixed. I just placed the _root.man.gotoAndStop(1); on the last frame in my attack movie clip not the man movieclip.

 
Comment by awesty
2006-12-11 15:28:10

@Hats: You would just have to set up the other enemy the same, put the same code on it, make another set of health bars and just add to the code already on ‘man’. But make sure none of the instance names are the SAME!!!

 
Comment by RDB2006
2006-12-12 02:36:44

any1 no how to make it so that when u move your char into a square, and move it around the square, it leaves a trail, Im making a mining game wer u go through the ground by drilling it on a machine thingy nd i need it so that u rnt just moving around the ground without clearing a path

 
Comment by Hats
2006-12-12 07:04:44

Would that work though? I mean I’ve got 2 seperate enemies on there with different instances but when ya beat either one of them it moves forward in the frame. I wanna make it so they both have to be beaten before it moves on rather than just one.

 
Comment by TYLER
2006-12-12 12:33:40

is there a code to make the enemys attack u?

 
Comment by awesty
2006-12-12 15:48:45

@RDB2006: Yes, I may do a tutorial on it. If you want to google it or something though it has to do with duplicating movieclips.

@Hats: Yep, I see what you mean. Instead of having something like this though:

if(_root.hp <= 0){
_root.gotoAndStop(2);
}

You would do this:

if(_root.hp <= 0 && _root.hp2 <= 0){
_root.gotoAndStop(2);
}

So then it makes sure both are dead.

@TYLER: Yes.

 
Comment by Me
2006-12-12 20:39:56

Heeelp…My character get very fat after walking….its nothing whit the animation,i have checked…

 
Comment by hats
2006-12-12 21:34:03

Brilliant thank you, I’ll give it a try

 
Comment by Hats
2006-12-13 00:38:17

Worked like a charm, thanks a lot.

Sorry to ask more questions but you’re helping me understand a great deal. I’ve got a movie clip where the enemy attacks you if you don’t attack it first and I want it to advance to the next frame if it reaches the end of that clip.

Obviously I could have all the enemies as different movie clips and change the code on them all to navigate to the right frame number, but is there a way I could use the same enemy movie clip with different instance names instead with some kind of command to just advance to whatever the next frame in the game is?

Many thanks

 
Comment by Hats
2006-12-13 01:43:46

I’ve found one way round that problem but I’d still like to know if there’s a command for that. Also one other problem I’ve encountered is when using the…

if(_root.hp

 
Comment by Hats
2006-12-13 01:46:25

ok clearly it wont let me put that, the jist of it was that i wanted to add a third enemy into the mix and did it by just using the && thing again after the first two but it didnt work. Is there something else I need to do when working with more than two enemies? Like the equivalent of a comma?

 
Comment by Bryce K :P
2006-12-13 08:38:57

I downloaded e2eSoft VCam but how do i work it lol

 
Comment by Bryce K :P
2006-12-13 08:41:53

oh also how do u make ur guy run up walls? Also when i used ur jump TOT i couldn’t figure out how to make him jump ._. (i deleted the gray parts)

 
Comment by awesty
2006-12-13 17:11:02

@Me: Make sure you dont resize him. If you do, when he walks he will go back to the origanal width.

@Hats: Umm… Each movieclip can only have 1 instance name, but if you wanted it to change frame, you coudl do this:

if(something happens){
this.gotoAndStop(FRAME);
}

About the third enemy, make sure you got the instance name right. Also, make sure you have the && there. That means and. Also, “or” and “||” both mean or, so if you wanted it to change when any of the enemies died you could use that.

@Bryce K: What do you mean it won’t work? Do you know how to use it?

Also, about running up walls, it depends what you mean. Do you mean run up and flip of, or be able to walk on walls like a fly?

About not making him jump, just try following the tutorial, it should work.

 
Comment by Hats
2006-12-13 20:56:51

Sorry, I didn’t explain that very well. I didn’t mean one movie clip with different instance names, I just meant the same clip, duplicated, so like a few versions of the same movie clip on the frame window at the same time and each one of those movie clips had a different instance name.

And with the navigation bit, I know how to get it to move to a specific frame but I was just wondering if there was a command that takes you to the next frame without specifying the frame number. It’s cool though there’s ways around it. Thanks for the help

 
Comment by xtreme
2006-12-13 23:48:46

I don’t understand how you make the animation of the guy walking or attacking into a movieclip! I have 21 keyframes my guy walking, but how do I convert those 20 frames into a movieclip

 
Comment by xtreme
2006-12-14 05:52:26

ok i know how to make movie clips and my game is working fine but I was wondering how do i get to the attacking frame in an actionscript I tryed
(_root.man(3)){
but it didn’t work!!!!!!!!

 
Comment by Bryce K :P
2006-12-14 06:06:34

yah i dont no how to use it do i just open it and use it in a flash swf file?

And when i mean running up walls play Matrix Bullet Time fighting and u will no wut i mean its at addictinggames.com

and when he jumps the error says
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 6: Statement block must be terminated by ‘}’
onClipEvent(enterFrame){

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 49: Syntax error.

Total ActionScript Errors: 2 Reported Errors: 2

 
Comment by Bryce K :P
2006-12-14 06:08:25

and my formula is this

onClipEvent(load){
var jump:Number = 0;
var falling:Boolean = false;
var g:Number = 4;
}
onClipEvent(enterFrame){

if(jumping == false){
if(!falling){
jump = 0;
}
if(Key.isDown(Key.UP)){
jump = 15;
jumping = true
}

}
if(jumping == true){
jump -= 1;
}
if(jump

 
Comment by Bryce K :P
2006-12-14 06:09:11

the rest got cut off but i think all you will need if the first part :P

 
Comment by Oakheart
2006-12-14 16:30:19

Ok iv ben studying this for over two hours now… and its like my animation is bypolar becuase if one thing works, somthing else dosnt… i finily got my attack not looping.. but not the health bar dosnt work what do i do? i got

onClipEvent(enterFrame){
this._xscale = _root.hp;
if(_root.hp

 
Comment by xtreme
2006-12-14 19:31:58

ok my problem is that when my change direction my character mirrors its self half way across the screen can anyone help me?
Here is my game http://www.swfup.com/play.php?id=3320

 
Comment by Oakheart
2006-12-15 08:04:18

nvm i figured it out by my self and my game looks sweet! nice tut

 
Comment by Bryce K :P
2006-12-15 10:13:22

xtreme ur problem is when he runs the space he walks is to far out (when he exstends his leg it goes to far) to the opposite of that will make it so ur charecter will mirror it self. I think that should explain it but myabe you should try a go at it awesty

 
Comment by awesty
2006-12-15 11:25:23

@Hats: You could use:

gotoAndStop(_root.nextFrame());

@xtreme: Just use the code in the tutorial. It doesn’t say to use (_root.man(3)){, that doesn’t make any sense.

With the mirroring problem, I dont know what Bryce K is talking about. The problem is your registration point. When you double click on your movieclip, you should see a little cross somewhere in it. Make it so that is in the center of you MC. That will fix the problem.

@Bryce K: I need the rest of the code to figure out the problem. It cuts out at angle brackets, so if there is one just replace it with LESSTHAN or GREATERTHAN, so I know what it was.

 
Comment by Bryce K :P
2006-12-16 00:44:10

ill just e-mail you the code :P

 
Comment by Bryce K :P
2006-12-16 00:46:07

oh and also did you say you were going to make a scripted camera TUT cause i have no idea how to use one :P

 
Comment by 3dgamo
2006-12-16 13:22:35

how do u make like the frames that animate ur character into 1 movieclip?

 
Comment by awesty
2006-12-16 17:07:57

@Bryce K: Its pretty simple. Just motion tween the camera around the stage (make sure the stage has something on it). If you make the camera smaller, it will zoom in and vice versa.

@3dgamo: I don\’t know what you mean by frames that animate your character. :S

 
Comment by Bryce K :P
2006-12-17 01:05:46

lol i have no idea wut ur talking about if i open up the camera it says select a .swf file… XD

 
Comment by xtreme
2006-12-17 01:46:28

thankyou awesty the tutorial worked great! I was wondering if there is a way of making the attack play once if you old down space insted the attack looping.

 
Comment by awesty
2006-12-17 10:58:32

@Bryce K: Lol… looks like you have a different camera to me :P
@xtreme: There is, but it would be easier to do if the code was set up differently, so Im not going to go into that now.

 
Comment by Bryce K :P
2006-12-17 11:18:22

uhh i have e2eSoft VCam is that the correct camera?

 
Comment by awesty
2006-12-17 13:33:26

Lol, Im not sure, but if its the same as mine try opening the .fla and you should see a frame type thing.

 
Comment by Bryce K :P
2006-12-18 00:08:51

T-T i could really use that TUT on a scripted camera :P

 
Comment by Bryce K :P
2006-12-18 00:09:38

also could you suggest some Links? i looked at ur Links but i dont think there is anything in there cause i have a little problem :P

 
 
Comment by mart
2006-12-18 13:27:29

mine when i test it says NaN were it should say 100 plz could you help me.

 
Comment by Bryce K :P
2006-12-19 01:03:14

i think i got the wrong V-cam…

 
Comment by Bryce K :P
2006-12-19 01:08:14

were can i get i searched on Google but couldn;t find it it’s all about this Soft Cam thingy

 
Comment by Naso
2006-12-19 13:59:54

hey awesty, great tutorial, made me finally understand some action script. Hey, i wanted to make a sort of a Super move that needs more than one key to be pressed like, down, left, punch, that sort of thing. I just couldn´t pull it out.

Also, how can you make a move that requires anoter move to be preformed first, like a low kick that needs the character to duck first or a chained sequence of attacks?

Oh, yeah, i´m doing a KOF sort of game so i´m expecting it to get complicated :)

 
Comment by Naso
2006-12-19 14:14:38

sorry for posting again, but if the code is too long my email is elnaso_xfxd@hotmail.com.

keep making great tutorials man

 
Comment by awesty
2006-12-19 17:44:01

@mart: Make sure on the frame you have:

stop();
_root.hp = 100;

@Bryce K: I think the one you got is for web cams. Try this one:

http://www.fat-pie.com/animationextensions

Its not the same as mine but it is better, it can rotate and blur.

@Naso:

I have no idea what KOF is, but here is what you asked.

For a move that needs more than one key pressed at once, you could do this:

if(Key.isDown(Key.LEFT) && Key.isDown(Key.RIGHT)){
do super duper move;
}

That is obviously for the left and right keys pressed at the same time. && means and, and || and or mean or, so use them is you want to use multiple things.

If you want him to do a low kick if he is ducking, assuming you have the ducking worked out. Make a variable duck, that is true when he is ducking. Then for the attack code, you would have to do:

if(Key.isDown(Key.SPACE)){
if(duck == true){
low kick;
}else{
normal kick;
}
}

Hope that helps.

 
Comment by Hats
2006-12-20 00:28:18

Hey I guess this probably isn’t relevant here but I didn’t know where else to ask. Basically I’ve made it so that the guy crouches when ya press down and crawls with down and right. This is working brilliantly but problems came when I made an obstacle that ya have to crawl under.

I’ve made it so ya have to crawl to start with in order to get under it by putting a “_root.man._x -= 5″ command on the obstacle if it hits the man, but when he’s on his way through he just stands up if you release the crawl button. I don’t want him to be able to stand up until he gets to the other side of the obstacle.

I’ve tried puttin a MC behind the obstacle that would send him to the crawl MC if it touches him but I can’t seem to get it to work. Any help would be brilliant.

Thank you and I hope that didn’t confuse ya too much, don’t think I explained very well.

 
Comment by Bryce K :P
2006-12-20 02:51:36

Thanks but it wont let me install it it says the program cannot be read could you show me where you got ur vCam? Thanks (good TUTs)

 
Comment by Bryce K :P
2006-12-20 11:13:19

Oh yes also, ive been trying to get a good script but all of them suck. I’m trying to make my ball (he can jump (gravity works) and move left to right) but when he hits a wall i want him to stick to it and only be able to move up and down. Then when he gets of the wall he will go back to the ball that can jump and move left to right
PLZ HELP!!!

 
Comment by Max
2006-12-20 19:09:15

This looks like a great tutorial. I’m really new to flash, but if I can get the animation, I think I’ll make this my next project.

Please, could you make another tutorial showing how to make a fighting game enemy that fights back? I think I can do multiple moves, so all I’d need is a real opponent for something resembling a game. =)

 
Comment by Bryce K :P
2006-12-21 00:56:45

@Max: You could do one of two things, one make the enemy fight mnaually. Or you could give it AI saying to follow you (do awesty’s AI tutorial) then you can make it so your enemy hits you if your in the air,on the ground when you duck or regularly if you are neither. You could also make him jump when you attack with one of your moves.

 
Comment by Bryce K :P
2006-12-21 02:15:49

AWESTY!!

First of all i still need that link for a vCam
Second i need a script to climb up ladders or walls or something
Third my script doesn’t work… its cause the two butttons dont work when i press them together

onClipEvent(enterFrame){
if(fight == false){
if(Key.isDown(Key.LEFT) && fight != true){ && if(Key.isDown(Key.TAB)){ && fight != true){
this._x -= 4;
this._xscale = -100;
this.gotoAndStop(4);
}else{
this.gotoAndStop(1);
}
}
if(Key.isDown(Key.RIGHT) && fight != true){ && if(Key.isDown(Key.TAB)){ && fight != true){
this._x = 4;
this._xscale = 100;
this.gotoAndStop(4);
}else{
this.gotoAndStop(1);
}
}

and my errors are
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 28: Unexpected ‘&&’ encountered
if(Key.isDown(Key.LEFT) && fight != true){ && if(Key.isDown(Key.TAB)){ && fight != true){

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 32: ‘else’ encountered without matching ‘if’
}else{

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 36: Unexpected ‘&&’ encountered
if(Key.isDown(Key.RIGHT) && fight != true){ && if(Key.isDown(Key.TAB)){ && fight != true){

Total ActionScript Errors: 3 Reported Errors: 3

I know its a lot but i really need ur help. Its really nice how you help people and take time to teach us this stuff.

 
Comment by Hats
2006-12-21 08:03:59

Bryce try changing the command line to this:

if(Key.isDown(Key.DOWN) && Key.isDown(Key.TAB) && fight != true)){

and then the rest…

I haven’t tested it but it’s what I use on something else, just minus the fight variable. Hope it helps.

 
Comment by awesty
2006-12-21 10:47:07

@Hats: So on this guy, you would have something like

if(Key.isDown(Key.DOWN) && Key.isDown(Key.RIGHT)){
Crawl;
}

Or something like that right?

Try changing it to this. In the onClipEvent(load){ Make a new variable called _global.crawl, and make it false to begin with.

Now change the code I posted above to something like this:

if((Key.isDown(Key.DOWN) && Key.isDown(Key.RIGHT)) || crawl == true){
Crawl;
}

And on the obstacle put:

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
_global.crawl = true;
}else{
crawl = false;
}
}

Try that, it should work.

@Bryce K: Send the .fla to

awestyproductions[@]gmail[.]com.

Do you have Flash 8? If not you will need to download the flash extension manager (i think thats what its called) to install the vcam.

Also, try changing it to this:

if(Key.isDown(Key.RIGHT) && fight != true){
if(Key.isDown(Key.TAB) && fight != true){

That will work, so will Hats way.

@Max:

Try the AI tutorials.

http://www.awestyproductions.com/tutorials/

 
Comment by Naso
2006-12-21 11:28:45

Hey, me again. Got another question for ya, whatch my movie here first:

http://i120.photobucket.com/al.....eroXVI.swf

Ok so I wanted to know how to do the dust effect without including it in the mc where the guy runs, that way, it will still play if the guy stops running (try hitting the keys really fast), and I won´t have to tween the dust mc so that it doesn´t get dragged with the guy… well you´ll get it better if you watch it. :)
oh btw, kof is short for King of Fighters, an amazing arcade by snk, possibly the best balanced game of it´s type.

i´ll be back with more questions later. :P

 
Comment by Bryce K :P
2006-12-21 11:32:04

I got flash 8 the program just wouldn’t load cause it said they’re were to many errors on the program i was downloading

 
Comment by awesty
2006-12-21 11:41:15

@Naso: You could duplicate a MC of dust, that fades away. So every 3 seconds or something the dust appears and fades. That could work. Btw I love your character :D
@Bryce K: The vcam file is a .mxp right?

 
Comment by Bryce K :P
2006-12-21 11:41:50

no its not a .mxp

 
Comment by awesty
2006-12-21 11:44:57

What file type is it?

 
Comment by Bryce K :P
2006-12-21 11:51:12

oh whopps it is an .mxp sry, also that tab and right thing worked thanx

 
Comment by awesty
2006-12-21 11:52:17

Just double click it and it should open in Flash Extension Manager or something. Then install it from there.

 
Comment by Bryce K :P
2006-12-21 11:54:42

how do i import it yo the stage then?

 
Comment by awesty
2006-12-21 11:55:35

Click Windows>Other Panels and it might be there.

 
Comment by Bryce K :P
2006-12-21 12:03:35

I installed the camera now wut do i do open flash 8?

 
Comment by Bryce K :P
2006-12-21 12:06:44

nvm i figured it out TY ^_^ but i would like to know, how do i make it when i press the Letter key “l” gotoAndPlay (5); it says “l” is not a key

 
Comment by Naso
2006-12-21 12:07:00

but it´s supposed to be only when he starts running :S

 
Comment by Bryce K :P
2006-12-21 12:17:38

oh yes awesty one more thing the camera is weird, i motion tween it but nothing happens it just shows this box moving up and down -_-

 
Comment by Bryce K :P
2006-12-21 13:50:08

i wanna make it so when my guy moves the camera moves :P

 
Comment by Hats
2006-12-22 03:59:07

ah thank you, i’ll give it a try

 
Comment by Hats
2006-12-22 04:43:52

Brilliant it worked, awesty whoever you are you’re a legend lol, thank youuuu

 
Comment by awesty
2006-12-22 11:17:59

@Bryce K: Did you do Key.isDown(Key.l)?

Btw just download this vcam:
http://www.awestyproductions.com/images/V-cam.fla
Just move it and resize it to change the stage.

@Naso: Yes, you could make it do that.

I will remember to do a tutorial on it if you post it here.
http://www.awestyproductions.c.....s/request/

 
Comment by KIM
2006-12-22 15:40:38

HEY!
I NEED HELP!
can you tell me how to make your character JUMP if you press UP?! pls help me?

THNX ALOT

 
 
Comment by KIM
2006-12-22 18:59:23

oops

yeah your right… sorry…

but, i have another problem. i placed this on my sword MC

onClipEvent(enterFrame){
if(this.hitTest(_root.enemy)){
_root.enemy. gotoAndStop(3);
}
}

at the third frame of the enemy is the exploding part. so will it work? cuz it did’nt in mine =’(

 
Comment by Hats
2006-12-23 10:20:27

Kim did you do it with the space before gotoAndStop?

Try it like this…

onClipEvent(enterFrame){
if(this.hitTest(_root.enemy)){
_root.enemy.gotoAndStop(3);
}
}

and make sure the instance name is def set to enemy on the movie clip… otherwise it should be fine

 
Comment by awesty
2006-12-23 12:21:43

Yea, Hats is right.

 
Comment by KIM
2006-12-23 13:19:30

now i remember what my friend said =) thanx

 
Comment by KIM
2006-12-23 20:57:41

(”’)^.^(”’)

my game is done, thnx

(”’)^.^(”’)

 
Comment by Phalanx
2006-12-25 02:53:08

Hey awesty, your tutorials are really, really helpful - I check this website almost every day and constantly add stuff to my flash games :)

I’m making a side-on shooter and I’ve got the movements mc’s done, hp etc.

What I would like to know is how can you get the cross-hair to match with your mc’s arm movements (like in heliattack 2 and 3 [if you haven’t played it, it might be best if you do, that way you’ll know what I mean), you aim with the mouse and the guy’s arms follow the directions). Basically, it allow 360 degrees of fire. I’m guessing it’s something to do with rotation and mouse, but that’s just a guess.

Also, bullets are being a pain in the rear - I’d like it so on mouse click, the bullet appears from the gun (again, like heliattack 2/3). I’m not ripping off heliattack 2/3 - I just want that particular method of shooting (or rather, aiming)

Many thanks in advance.
Happy holidays too.

 
Comment by Hats
2006-12-25 04:13:20

Hey just a quick question, how would I incorporate sound into an if statement? for example…

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
(play sound)
}

Any help would be greatly appreciated… thanks as always

 
Comment by Hats
2006-12-25 04:39:25

Sorry to double post but can ya tell me how to get the sound to stop as well when it changes to another frame of the man instance please? Should I request this in the tutorial request thing instead? Could be a big subject I guess…

 
Comment by Phalanx
2006-12-25 04:42:10

I just found a tutorial made specifically on the thing I wanted (360 degrees firing). So no need to answer my question

Happy holidays anyway.

 
Comment by KIM
2006-12-25 15:35:37

hey hats try this on the thing that you will make sound if it hits the man i think it works cuz it works in mine =)

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
this.gotoAndPlay(2)
}

put the sound on the 2nd frame of the thing that will make sound and make this on the 2nd frame of the enemy

stop();

anyway
happy hollidays

 
Comment by KIM
2006-12-25 15:37:52

or if you want that just once

do this on the first frame of your enemy

stop();

 
Comment by KIM
2006-12-25 15:40:45

and if you want it just once
(sorry if im doing it in different replys)

code to the enemy:
onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
this.gotoAndStop(2)
}else{
gotoAndStop(1)
}
}

 
Comment by Amar Ravi
2006-12-26 02:01:21

Hi i am Amar,
i wanna create a game in flash. i want to create a superman game. my brothers too fond of it . Please help me on this. if u hav any tutorial just e-mail it to me

 
Comment by Hats
2006-12-26 04:53:37

Hey cheers for the help kim, I wanna know more about controlling the sound through actionscript though rather than just assigning it to frames… I know there’s ways of doing it but I don’t have the best grasp on it atm, I’ve managed to create a sound object and get it to play but can’t get it to stop :op… makes me sound a bit stupid but its all a learning curve. Oh and a merry christmas to you and everyone else here!

 
Comment by Hats
2006-12-26 04:54:34

…that was meant to be a little pokey out tongue thing… maybe this :p enjoy!

 
Comment by Bryce K :P
2006-12-26 11:21:47

thanks for the Vcam awesty it rocks :P

 
Comment by Bryce K :P
2006-12-26 11:26:31

now how do i make it when my guy moves the V-cam moves?? :P

 
Comment by Hats
2006-12-26 23:16:58

Ah scrap what I said I’ve got it covered now… thanks anyway

 
Comment by awesty
2006-12-29 10:58:43

@Hats: I still might do a tutorial for it.

@Amar: What would this superman game involve?

@Bryce: Well give it an instance name, and where it says:

if(Key.isDown(Key.LEFT)){
this._x -= 5;
}

Put this:

if(Key.isDown(Key.LEFT)){
this._x -= 5;
_root.vcam._x -= 5;
}

Or on the vcam you could put:

onClipEvent(enterFrame){
this._y = _root.man._y;
this._x = _root.man._x;
}

But you would have to make sure that the registration points are in the same spot if you know what i mean.

 
Comment by KIM
2007-01-03 17:43:16

what is that “Vcam” that you are talking about

sounds cool :) lol

 
Comment by Daniel
2007-01-04 02:20:12

I would like to know about the vCam thing too please

 
Comment by awesty
2007-01-04 08:35:57
 
Comment by daryl
2007-01-05 09:56:31

hey , i know this sounds stupid, but i cant get it to work as i cant turn the separate keyframesinto one movie clip for example: fighting

 
Comment by awesty
2007-01-05 17:10:43

Try making a blank MC (Ctrl F8) and then use that.

 
Comment by daryl
2007-01-06 01:35:38

hey how would you make it so that when a ball comes in contact with his foot he can kick it (with the fighting movie clip)

 
Comment by awesty
2007-01-06 11:33:33

Well, I can’t tell you exactly how to do it… but it would be something like:

if(this.hitTest(_root.ball){
_root.gotoAndStop(KICKFRAME);
//Kick code
}

Something along those lines.

 
Comment by Daniel
2007-01-07 07:26:45

umm the V-Cam thing looks cool but what does it do ?

 
Comment by awesty
2007-01-07 08:43:10

It controls the stage width, height and position. So you can easily zoom in and out.

 
Comment by Daniel
2007-01-07 09:02:54

Oh ok i see, thats really useful.

 
Comment by Daniel
2007-01-08 03:52:05

How would i can i make my chracter do something when i press not one but 2 buttons at the same time.
Would it be something like
if(Key.isDown(Key.RIGHT && Key.AnyKey)

 
Comment by daryl
2007-01-08 08:36:30

hey, i have gone and done what you have told me to do (the script for ‘man’)but when i preview it, i cant move it….so when i press the left arrow it is supposed to go to the 3rd frame but it doesnt , instead i have to press enter for it to go to the next frame(starting at one,to the three) i have no control , how is this??

 
Comment by bob
2007-01-08 08:47:47

hey , just wonderin if u are to put;onClipEvent(load){
fight = false;
}
onClipEvent(enterFrame){
if(fight == false){
if(Key.isDown(Key.LEFT) && fight != true){
this._x -= 4;
this._xscale = -100;
this.gotoAndStop(2);
}else if(Key.isDown(Key.RIGHT) && fight != true){
this._x = 4;
this._xscale = 100;
this.gotoAndStop(2);
}else{
this.gotoAndStop(1);
}
}
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(3);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}
in every frame of the man movieclip?

 
Comment by kevin Subscribed to comments via email
2007-01-09 02:01:56

I did the keyframe for the attacking frame but it doesn’t work i did everything u told me to do. I need your help tell me exactly every step what to do by sending me a email.

thanks

 
Comment by kevin Subscribed to comments via email
2007-01-09 02:06:47

yo the third frame is your attacking frame so when you click enter its supposed to go there I know all their is to know about his tutorial its just the attacking frame isn’t working exactly.
I put a new layer and put a keyframe at the last frame like you said but nothing works man. Can u help me?

 
Comment by Naso
2007-01-09 11:20:50

I´m making a character selection screen and I have added several characters but I just can´t figure out how to make the character you select be the one that appears on the next frame. help :

 
Comment by Ryan
2007-01-10 11:58:35

Ok, well i need help. I have the game done and working, but is there a way to make it so the health wont go down when the guy just stands there? mine is doing that. HELP!

 
Comment by KIM
2007-01-10 20:15:49

ok… so what dose the “v-cam” do?

thnx

 
Comment by KIM
2007-01-10 20:26:28

lol, srry, i tried that v-cam thing and it rocks!!!!!!!!!!!!!!!!!!

 
Comment by Naso
2007-01-13 03:22:51

wow I don´t even understand how a v-cam works. damn.

 
Comment by awesty
2007-01-13 15:46:43

@Daniel: if(Key.isDown(Key.LEFT) && Key.isDown(Key.RIGHT)){

@Daryl: If you wanted it to go to the next frame if you pushed the right arrow key, you would do this:

onEnterFrame = function(){
if(Key.isDown(Key.RIGHT)){
_root.gotoAndStop(nextFrame());
}
}

Put that on each frame.

@bob: No, just on the man MC itself.

@Kevin: Just send the .fla to:

awestyproductions[@]gmail[.]com.

@Naso: The easiest way would be to have a different frame for each character. So if you selected Fred, it would take you to frame 3, which would have Fred on it. If you selected 1337h4×0r it would take you to frame 4, which would have 1337h4×0r on it.

@Ryan: Just send the .fla to

awestyproductions[@]gmail[.]com.

 
Comment by Mattsta
2007-01-15 17:19:10

awesty mate,

2 things,

1. how could i make an alternate close combat attack?

2. how could i make him shoot?

thanx man your tutorial Rocks!!!

 
Comment by mark
2007-01-16 18:44:38

is there a place where i could down load the file because i’m not unerstanding it

 
Comment by Seerex
2007-01-17 00:26:07

please help!

i need some help here :P..

u see, mine doesnt work at all.. like if i add walking code so i can move him, he cant attack, but if i only add attack code, he can attack (but he keeps repeating attacking tho).. how can i fix that? i cant make him do it right..

next, when i pick up an item… like u said in ur tutorial about the rpg thing, he picks it up, but the sword doesnt become visible in my inventory box.. just stays at 0 alpha.. help please

 
Comment by Naso
2007-01-17 10:35:34

alredy done that. somehow it makes the moves loop again like before. help?

 
Comment by alex
2007-01-17 13:07:39

im still stuck at the fight loop, i put the name as “man”… but it wont stop…HELP

 
Comment by Mattsta
2007-01-17 13:19:10

its ok ive learned how to make an alternate close combat attack but how could i make him shoot

 
Comment by Bryan
2007-01-19 12:16:55

Hey I am having alot of trouble with this. I put in your code and it doesnt play my stand Movie Clip, it moves right and left but there is no walking, I am guessing that it is still stuck on frame one and then it doesnt do anything after I do the attack. Just stops all frames. This isnt the only tutorial code that has done this. If you can help my out that would be awesome

 
Comment by awesty
2007-01-20 11:29:44

@Mattsta:

1. If I told you everything, would you really learn anything?

2. http://www.awestyproductions.c.....ng-system/

@mark: No sorry.

@Naso: Ugh… I seriously dont know why that would happen if the code stays the same. Maybe you were refering to a frame in the code somewhere, and since it is on a different frame it screws up.

@Seerex: You could email the .fla to:

awestyproductions[@]gmail[.]com but I might not be able to get back to you for a week or so.

@alex: Make sure you didn’t miss any of the code.

@Bryan: Make sure you did as the tutorial said, and didnt so something wrong.

 
Comment by Rage
2007-01-20 13:38:13

I tried to make my enemy move as a second player, but when i did, the other character moved as well. I used the same code on both characters only changed the keys that were pressed and the way they faced. I thought that the code might be non-copyable (if thats even a word). Can someone help me

 
Comment by Evgon
2007-01-21 11:50:08

Hey! I am using Flash 8 Professional. I am having trouble on the same spot no matter how many times i do it over again!

Here’s the spot:

_root.man.gotoAndStop(1);

I put it in the man->attack in a new layer. I made a new keyframe and pasted it in. When I hit space to attack it just keeps attacking. Maybe it is the version of flash im using…. PLZ HELP.

 
Comment by awesty
2007-01-21 20:22:13

@Rage: That shouldnt happen if you do it right.

@Evgon: Try chaging to to _parent._parent.gotoAndStop(1);

I have no idea if that will work or not.

 
Comment by Evgon
2007-01-22 15:44:27

LOL! Thanks! It actually worked!

 
Comment by Rage
2007-01-24 09:40:15

I realized that using getcode() wont work, i actually needed to put in the code for A and D, so it works now.

 
Comment by dude
2007-01-25 10:25:59

i dont understand putting the movie clip into the first frame on ur tute

 
Comment by kirst
2007-01-26 02:32:48

k, well i tried all that and i did it in order but when i test it, my character wont move properly. When he attacks he always turns to the left and when im moving, it doesnt turn in the direction im pressing. and it stretches out too, but i kinda fixed that by changing this._xscale = 100; to this._xscale = 75;

 
Comment by Plasma
2007-01-26 11:10:05

How do i get a whole walking sequence into one frame?

 
Comment by awesty
2007-01-26 11:13:34

@Evgon: Lol, I wasn’t expecting that. xD

@Dude & Plasma: You need to make a movieclip of the walking sequence and put that on the frame.

@Kirst: Did you resize the MC when you put it on the stage?

 
Comment by Plasma
2007-01-26 11:43:17

I’ve worked out everything, no errors appear and I have all the code but when I hit space my guy doesnt attack =:(

 
Comment by Timmy
2007-01-29 05:23:10

ummm awesty…how can i make the guy run if u press a button, like u press left and he walks towards the left, and then u press a button like g and he moves faster (runs)???

 
Comment by awesty
2007-01-29 08:52:34

@Plasma: Well I cant really help you, if you have done everything right it should work just fine.

@Timmy:
if(Key.isDown(Key.LEFT)){
if(Key.isDown(Key.DOWN)){
this._x -= 10;
}else{
this._x -= 5;
}
}

 
Comment by Bryce K
2007-01-29 13:01:43

Hey Awesty,
I need some help how do you make it when you move your move up the person holding the gun/weapon move up? So the gun reacts to the movement of the mouse.

 
Comment by awesty
2007-01-29 20:35:14

Huh? …when you move your move up?…

 
Comment by Bryce K
2007-01-30 12:03:17

oh whoops lol, i ment when you move your mouse up your movieclip moves up as well, just like in common shooting games as Heliattack, or this game right here, http://crazymonkeygames.com/Stickman-Sam.html

 
Comment by awesty
2007-01-31 15:55:01

@Bryce K: Do you know any trigonometry.

I might do a tutorial on it one time.

 
Comment by Bryce K
2007-02-01 13:38:15

ummm… awesty im 13 i have no idea what trignomitry is and Anonymous is creeping me out… you should erase all his comments…

 
Comment by awesty
2007-02-01 20:58:53

Yea, I think he wont be back again. I have installed some good plugins. But you expect me to delete 300+ comments manually a day!? :P

You will probably learn trig in a year or two in school. It involves finding out the angles or side lengths of a triangle using mathematic functions (sine, cosine and tangent).
Once you get the hang of it, you can do some really cool stuff with it in flash.

 
Comment by Bryce K
2007-02-02 11:49:47

cool ty

 
Comment by Doey
2007-02-04 13:42:45

help me im really new to Flash MX ive done wat it says but i cant seem to be able to attack i can only move and it stays on the same standing still pic its really pissing me off so please awesty can u make one of those slide show instructions i understand those ones perfectly…

 
Comment by Oddity_Aaron
2007-02-04 14:22:05

Hey Awesty, Great tutorial. Im very new to flash but I’m proud of what has come of my game out of this tutorial. I just have one problem. I am trying to make my character die when his HP reaches zero.This is what I have done.

onClipEvent(enterFrame){
this._xscale = _root.playerhp;
if(_root.playerhp

 
Comment by Oddity_Aaron
2007-02-04 14:27:03

erg it cut off becuase of the lesser than signs….

THIS is what Ive done ( [ = lesser than )

onClipEvent(enterFrame){
this._xscale = _root.playerhp;
if(_root.playerhp [ 0){
_root.playerhp = 0;
_root.playerHP.gotoAndStop(2);
_root.man.gotoAndPlay(6);// death animation
}
}

Everything goes as planned except the death animation doesnt play unless I kill the enemy at the exact moment I die. I suppose there is a Hit test conflict some where. If you would like I can send you the file so you can take a look at it.
Thanks.

 
Comment by Kurt
2007-02-05 05:06:36

ON TOPIC:
Well I’m really new to the gaming stuff and when you said their would be a few bugs i tested it and the guy i made just stood their and did nothing.

OFF TOPIC:
Sorry that this is off topic but, how do you make a next and previous button and make it link to the next frame?

And can you also tell me how to make a main menu button.

 
Comment by kiroe
2007-02-05 06:39:07

how do you make more than one frame in a movie clip(to make him walk and attack and stuff)

 
Comment by Kurt
2007-02-05 09:52:15

Ya kiroe is right.

 
Comment by Wasiu
2007-02-05 19:36:35

Hi Awesty. I learned very much things about AS and making games from Your tuts. I have One Question. When i touch (pounch -frame 4 in man) enemy, my and him hp going down… i wanna make fight game so i need function when i pounch, my hp dont going down… only him… how do this?

sory for bugs im polish guy and still learning :)

 
Comment by awesty
2007-02-05 20:05:21

@Doey: This is only for Flash MX 2004 and Flash 8.

@Oddity_Aaron: The probelm is that it is told to go to the death animation if the hp is less than 0 right? But above that, you are making the hp = 0. And since flash reads from top to bottom, it can never happen. So change if(hp < o) to if(hp == 0).

@Kurt: If you are having problems, try reading the previous comments. About the button, try this tutorial:
http://www.awestyproductions.c.....-in-flash/

@kiroe:Try reading some of the previous comments.

 
Comment by Kurt
2007-02-06 08:22:55

Well sorry about OFF TOPIC but it seems you never have replied to my e-mail well can you figure out how to make it so you can save a game name your file (i don’t care if you put name making or not) and if you refresh it is still saved. If you create a tutorial like that my game would be so much easier to make.

 
Comment by awesty
2007-02-06 15:56:22

@Kurt: Sorry that I havent replied to your email, but I have a life as well, and anyway I havent got an email from you >_<;

 
Comment by Eric
2007-02-07 02:44:47

All of your tutorials are great =) ! Keep up the good work. I have a question, did you go to macromedia flash classes or did you learn yourself?

 
Comment by D:
2007-02-07 10:50:57

ive tried and tried… could i have a .fla?

 
Comment by Kurt
2007-02-09 10:38:43

Well awesty ill tell you every thing i did and i will tell you the error , first i made 3 movie clips in each frame. Then i double clicked it with the black mouse i added some frames to the walking and running and attack on i did that, then i put the code :
1.
onClipEvent(load){
2.
fight = false;
3.
}
4.
onClipEvent(enterFrame){
5.
if(fight == false){
6.
if(Key.isDown(Key.LEFT) && fight != true){
7.
this._x -= 4;
8.
this._xscale = -100;
9.
this.gotoAndStop(2);
10.
}else if(Key.isDown(Key.RIGHT) && fight != true){
11.
this._x += 4;
12.
this._xscale = 100;
13.
this.gotoAndStop(2);
14.
}else{
15.
this.gotoAndStop(1);
16.
}
17.
}
18.
if(Key.isDown(Key.SPACE)){
19.
this.gotoAndStop(3);
20.
fight = true;
21.
}
22.
if(this._currentframe == 1){
23.
fight = false;
24.
}
25.
}
26.

On every frame on every man i don’t know what’s wrong even if i put the code on 1 frame. I’m only 11 so i might look stupid to you.

 
Comment by Kurt
2007-02-09 10:39:44

o sorry i didn’t say the error in that first one it is my guy can’t move or attack.

 
Comment by Kurt
2007-02-09 10:45:31

Ok now i can move but i can’t attack and the legs don’t move when he moves.

All i did was take away the #’s

 
Comment by Kurt
2007-02-09 10:48:36

The error says

WARNING: Duplicate label, Scene=Scene 1, Layer=Layer 1, Frame=2, Label=man
WARNING: Duplicate label, Scene=Scene 1, Layer=Layer 1, Frame=3, Label=man

 
Comment by Kurt
2007-02-09 10:49:51

Oh do i have to rename or i might figure out but tell me if i didn’t say i figured it out

 
Comment by Kurt
2007-02-09 11:19:45

Hey Awesty well i have no more errors my guy attacks but he doesn’t move when he moves ( left right and motion) and he also freezes when he attacks.

 
Comment by Kurt
2007-02-09 11:27:32

AND DON’T ASK ME TO TRY TO LOOK AND FIND AN ANSWER OUT OF LIKE 294 COMMENTS.

 
Comment by Kurt
2007-02-09 11:44:16

Ok i finally got every thing under control but the code : _root.man.gotoAndStop(1); doesn’t work for me you know i didn’t make an enemy yet lol.

 
Comment by awesty
2007-02-09 16:34:53

@Eric: I learn myself

@D: : No

@Kurt: Try one comment next time. Also, have you figured it out or not. I cant figure out your last comment.

 
Comment by Kurt
2007-02-09 23:44:16

Well i said i didn’t make an enemy but now i do but when i attack it keeps on attacking and i can’t move nothing the code : _root.man.gotoAndStop(1) didn’t work for me or i just didn’t understand you properly well what i did was , i made another layer on on the 3rd fame on the 2nd layer i put : _root.man.gotoAndStop(1) but dose it need to be on the attacking frame? do i put it on the last frame on the attack frame or is it another code?

 
Comment by awesty
2007-02-10 10:42:03

I think I suggested this to someone before and it worked…

Try replacing _root.man.gotoAndStop(1); with

_parent._parent.gotoAndStop(1);

 
Comment by Kurt
2007-02-11 06:05:11

Ok ill try and i put a comment on the cursor thing it might really help.

 
Comment by Kurt
2007-02-11 06:08:36

Ahhhhhh man still loops!

 
Comment by Kurt
2007-02-11 06:11:12

Ill try figuring out my self but i use flash 8 i put the code on the man on the attack frame on the last frame in their on layer 2 but it just says

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on/onClipEvent handler
1.

Total ActionScript Errors: 1 Reported Errors: 1

 
Comment by awesty
2007-02-11 12:15:46

You know you aren’t supposed to copy the numbers on the right of the code?

 
Comment by NP
2007-02-11 15:38:22

Hey, Awesty, you are awesome. Thank you so much for this. I once asked you about the health bar, my numbers representing health did not show up. Well, while doing this tutorial, I realized that I placed the “hp” into the instance, not the variable field. Thank you for all the hard work helping people. Have a great day/week/month/life =)
I will continue checking in, seeking for your great tutorials. Do make sure that you take enough breaks from writing the tutorials.)

With respect,
NP.

 
Comment by Kurt
2007-02-12 01:58:53

you mean i take away (1); ?

 
Comment by Kurt
2007-02-12 01:59:30

if it is its because I’m 11 and i don’t know to take that off.

 
Comment by FB
2007-02-12 07:44:03

while making this i got an error saying:
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 33: Operator ‘

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 34: Operator ‘>’ must be followed by an operand

if(Key.isDown(Key.LEFT) && fight != true){

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 38: ‘else’ encountered without matching ‘if’
}else if(Key.isDown(Key.RIGHT) && fight != true){

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 45: Statement must appear within on/onClipEvent handler
if(Key.isDown(Key.SPACE)){

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 49: Statement must appear within on/onClipEvent handler
if(this._currentframe == 1){
andi have no idea what this means

 
Comment by Oddity_Aaron
2007-02-12 10:17:29

‘Allo, Awesty. I posted a problem i had a while back but fixed almost right afterward. The game I’m making has turned out to look great and i’ve learned so much that I can usually debug any problems thanks to you’re tutorials. BUT, I have just one eency weency problem. It involves keypress commands. They interfere with a couple things. When the death animation is playing, hitting any key that is set to something starts the animation over. So basically as long as I hold a button he wont die, even though his hp is zero. Maybe I can just create a function like jump or fight, called death to make keypress false when death = true..Ugh I’ll try that. I would like to know if you wouldnt mind me emailing you with any code problems i get, Since im still a beginner.

Check out the demo, theres a link to updated versions there.
http://www.deviantart.com/deviation/48231966/

 
Comment by awesty
2007-02-12 19:27:55

@Kurt: I mean the line numbers on the left. I am guessing you put them in since there isnt a 1. in the code, so i guessed it was a page number.

@FB: It looks like you have put alot of the code on the frame when it is supposed to be on an MC.

@Oddity_aaron: I think the easiest way would be to make a death variable, that was true when it is dying. And make it so all the attacks and stuff cant happen while death is true.
You can send it to:
awestyproductions@gmail.com

Btw, your game looks pretty cool.

 
Comment by Karan
2007-02-13 09:56:26

Heya i’ve followed all of your tutorials up to here, I’m verrry new to flash, I was just stuck on the first part when you make then animations. I’ve drew the first, what do I do after that? I just need help on how to put them into one frame and what to do but after they are put into a frame I can do the rest. Thanks xD Karan

 
Comment by awesty
2007-02-13 16:06:00

You need to make each one a MovieClip, and then put each one on a serperate frame in a different MC. If you have trouble I have answered that question heaps of times before, so just have a look over the other comments.

 
Comment by Karan
2007-02-13 23:17:12

Ahh done, thanks xD

 
Comment by poo
2007-02-15 00:01:46

how do i make the enemy shoot back?

 
Comment by chelion
2007-02-15 05:13:30

For this bit:

onClipEvent(enterFrame){
this._xscale = _root.hp;
if(_root.hp

 
 
Comment by chelion
2007-02-16 04:47:51

how do i get it so that when you hit the walls you lose health

i have created a health bar from your health tutorial, and have tryed to combine the code for loseing health when you touch something with this, but at the moment you lost health without even touching the walls!

 
Comment by chelion
2007-02-16 04:59:53

I have put this on the action script for my man

if(this.hitTest(_root.walls)){
_root.hp -= (random(5)+1);
}

I have created a maze like thing witch is a movie with an instance name of walls.

however you just die staight away, i want you only to die if you hit the lines themselves.

 
Comment by chelion
2007-02-16 05:03:25

ive done some tests and its making you lose health in a square area round the maze.

 
Comment by awesty
2007-02-16 16:09:10

Huh?

 
Comment by J.P.
2007-02-17 09:02:05

At first I was doing good but when the action script part came I got these error when I tested my game…

WARNING: ActionScript 3.0 does not support actions on button or MovieClip instances. All scripts on object instances will be ignored.

I copied and pasted the actions but than that was all I got the “man” could not move nor attack all it did was stand still doing nothing :( please help I don’t know much about AS but I’m learning thanks.

 
Comment by awesty
2007-02-17 12:39:43

Well since you are using flash 9, you cant put the code on the MCs. You have to put the code on the frames, but replace onClipEvent(enterFrame){ with
man.onEnterFrame = function(){

And onClipEvent(load){ with
man.onLoad = function(){

 
Comment by Wasiu
2007-02-19 21:00:24

hi Awesty

your tuts are greats

i have one question

how to make moving path for my player…
need for simple platform game

 
Comment by awesty
2007-02-21 15:34:23

A moving path?

 
Comment by Kurt
2007-02-23 07:50:14

i figured out just _parent.gotoAndStop(1); just works for me.

 
Comment by Kurt
2007-02-23 07:52:39

but that error thing i think is because when i attack the punching bag the health doesn’t go down i think its just a simple error i made i can fix though.

 
Comment by Kurt
2007-02-23 07:59:34

Wow it works completely fine now!

 
Comment by Kurt
2007-02-23 08:00:56

This tutorial helps because i am making a game with my friends i don’t care about the Al thing because you have it on another tutorial thank alot though.

 
Comment by Kurt
2007-02-23 08:39:26

How do you make your guy only attack once even if you held the space bar for 40 years.

 
Comment by awesty
2007-02-24 10:26:03

Well where it says:
if(SPacebar is down){
attack;
}

You could change it to:
if(SpaceBar is down){
if(!down){
attack;
down = true;
}
}else{
down = false;
}

Down is a variable.

 
Comment by Alex Subscribed to comments via email
2007-02-25 10:05:51

I dont nderstand hoe youames toghter. Can you expain how to put the frames together?

sincerly Alex

 
Comment by chelion
2007-02-26 05:59:00

Sorry about my last post… wrong page. I have got that problem sorted now anyway.

I have made two games now with the help from your tutorials, you can play them on my site if you want (www.chelion.co.uk click games at the top)

 
Comment by Kurt
2007-02-27 09:02:06

Lol I’m using turned based combat instead of this now.

 
Comment by kiki
2007-03-01 06:28:01

i got….
**Error** Symbol=Man, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances
onClipEvent(load){

**Error** Symbol=Man, layer=Layer 1, frame=1:Line 4: Clip events are permitted only for movie clip instances
onClipEvent(enterFrame){

Total ActionScript Errors: 2 Reported Errors: 2

what does this mean can anyone help???? plz

 
Comment by chad
2007-03-01 15:08:31

hey mine is working and all but when i turn around my man skips over like half the screen

*=my man

* walking—–*—-* then i turn around and my man turns up here ^

 
Comment by Bob
2007-03-04 09:00:08

nice tuts, i wanna know if you can make it so that the enemy plays a dead animation like

if(enemy)
hit.test>this
gotoandplay(dead)

or something thx

 
Comment by awesty
2007-03-05 16:45:44

@Alex: Did you just bash your head against the keyboard, or cant you speak english?

@Chelion: Nice Work ;)

@Kiki: You have to put the code on the correct MC, not the frame.

@Chad: Make sure the registration point of the MC is in the center.

@Bob: if(_enemyhP <= 0){
enemy.gotoAndStop(dead);
}
But obviously with the correct names.

 
Comment by Bob
2007-03-06 07:09:19

does that dying code go on the enemy, hpbar,frame etc. ?
I tried the hp bar
didnt work
everything else did tho

 
Comment by awesty
2007-03-06 15:45:10

Bob: Well, it depends. If you put it on the enemy, you could just change the enemy on the next line to ‘this’, but if you put it on the hp bar you would have to change it to _root.ENEMYNAME.

Just whichever is easier.

 
Comment by Shadowdragon
2007-03-07 11:42:05

I tried putting the code that animates the character when he moves into another project I’m working on, but it doesn’t seem to work. In the character MC I have an “at rest” picture on frame 1 with the stop(); code. Frame 2 then starts the animation of the character walking. On the MC itself I’ve included the following code:
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._x -= 6;
this._xscale = -100;
this.gotoAndStop(2);
}else if(Key.isDown(Key.RIGHT)){
this._x += 6;
this._xscale = 100;
this.gotoAndStop(2);
}else{
this.gotoAndStop(1);
}
}
What did I do wrong?

 
Comment by Bob
2007-03-07 12:21:21

thx it kinda worked
one last question
is it possible to makeit so the enemy dies with one hit like

if(”punch”)
hit.test.enemy
enemy.gotoandplay(”dead”)

 
Comment by Shadowdragon
2007-03-07 13:24:11

OK, I’ve changed the code to:
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._x -= 6;
this._xscale = -100;
this.gotoAndPlay(2);
}else if(Key.isDown(Key.RIGHT)){
this._x += 6;
this._xscale = 100;
this.gotoAndPlay(2);
}
}
Now it’ll jump to the correct frame, but it wont play the walking animation until the key is released. I can’t seem to get it to play the walking animation when the key is held down.

 
Comment by Giuliano
2007-03-07 17:32:42

this is way to complicated. i advise you to make somthing different and more simple for learners

 
Comment by safwat
2007-03-13 02:23:09

where can i download this program from|?

 
Comment by Ahmed
2007-03-13 02:37:44

i don’t understand the Now make a new layer and make a keyframe on the last frame and put this code on it.

Code (actionscript)
_root.man.gotoAndStop(1);
Now when your man has finished attacking he will go back to his idle stance. If you test your movie now (Ctrl+Enter) It should be working fine part.
It doesn’t help and now i can’t do the attack.

 
Comment by jako
2007-03-13 17:59:05

WTF it’s called make a complete fighting game? why
there is nothing complete about this

 
Comment by Timmy
2007-03-21 09:41:04

check out this game i made with this tut
http://www.swfup.com/swf-view.php?id=7112

 
Comment by Timmy
2007-03-21 09:43:16

tell me what u think

 
Comment by awesty
2007-03-21 18:29:56

@Shadowdragon: Nothing that I can see. Make sure you have your scoping right etc…
Also that is very strange that it will only play once you have released the button :\

@Bob: Yea, you could make it so it takes of 100 Hp if you wanted.

@Giuliano: Who said this tutorial was for learners?

@safwat: http://www.adobe.com

@Ahmed: You do exactly as it says. Make a new layer, and on the last frame of the animation sequence put the code it says to put ;)

@Timmy: That is pretty good, but maybe make the controls a bit easier, my fingers were all over the place :P

 
Comment by Uzi Subscribed to comments via email
2007-03-26 01:11:16

how can i make combination attack? for example hold down the Down key (lol :P)and press the punch key (ex.Z) and release both of them and throw a fireball. Can anybody help me?

 
Comment by punkyboy14
2007-03-26 19:39:39

Warning:

Warning warning of the warning warning of the warning in the warning warning of the warning of the warning in the warning warning with the warning was really a false warning.

Is that clear?

 
Comment by akskater100
2007-03-29 07:30:42

im new to this, and how do you make the characters like the stand, walk , and attack?

 
Comment by bob Subscribed to comments via email
2007-04-04 11:14:29

WOW thanks awesty, mine now works thanks to your code, i may post it for you to see later. also, for graphics(if u suck at drawing) just get sprite sheets.

 
Comment by awesty
2007-04-05 13:02:25

@Uzi: It would be something like:
if(Key.isDown(Key.Down)){
if(Key.isDown(Some other Key)){
do fireball;
}
}

@akskater100: Maybe you should take some animation tutorials or something.

@bob: But the thing with sprite sheets is that it isnt your own work, and alot of the time it is very hard to find a sprite sheet with a character that suits the game.

 
Comment by bob Subscribed to comments via email
2007-04-06 07:55:56

True. But it is easier than drawing;)

 
Comment by bob Subscribed to comments via email
2007-04-14 05:25:45

oh btw, where could i upload ma game (not newgrounds)

Comment by Izzy Subscribed to comments via email
2007-08-30 12:38:09

www.sfdt.com
make an account
upload your flash

 
 
Comment by awesty
 
Comment by bob Subscribed to comments via email
2007-04-16 11:18:28

thanks

 
Comment by bob Subscribed to comments via email
2007-04-23 10:24:08

Hey Awesty, I have a major problem. First, I need to know how to duplicate and attach bullet mcs, second, I need to know how to make missles/etc that keeps going untill it hits you.

Comment by awesty
2007-04-23 17:36:04

There is a tutorial for a shooting system here:
http://www.awestyproductions.c.....ng-system/

 
 
Comment by bob Subscribed to comments via email
2007-04-24 04:51:54

howd i miss thet?

THX

 
Comment by Trunk Monkey
2007-04-24 05:44:39

Im new to this how do you make a moving animation of a stick man?

Comment by awesty
2007-04-24 20:00:46

There are many animation tutorials out there on the internet.

 
 
Comment by Trunk Monkey
2007-04-25 04:20:19

Yea but everyone I look at there really complicated and don’t really explain it well

Comment by awesty
2007-05-01 20:28:20

Well the easiest way would be to redraw the stick man in a new position each frame. I used shape tweens for the tutorial but I couldnt explain how I did it in a single comment.

 
 
Comment by green Subscribed to comments via email
2007-04-26 17:28:06

I’m new too. I have trouble with character movement. Which code required to change angle.

Comment by awesty
2007-05-01 20:26:17

You can use the _rotation property to increase or decrease a movie clips rotation.

 
 
Comment by gart
2007-04-29 04:01:13

@trunk monkey: just use sprites
it will make your life easier.
i add to the code because i was too
lazy to make stickmen.
i used naruto sprites

 
Comment by Uzi Subscribed to comments via email
2007-05-01 05:49:38

how do you make when : for example….when you hold a direction key, the movieclip is moving in that direction. You keep holding and when you release does an animation of a screech. (I mean it stops) I will make an animation of this request and post it to www.swfup.com :)

Comment by awesty
2007-05-01 20:22:06

Well you could make it so when the key is released it plays a different frame which the MC of the sliding animation will be. Then on the last frame on the sliding animation you can put some script that makes it go back to the first frame (the idle frame).

 
 
Comment by christian Subscribed to comments via email
2007-05-11 06:37:16

what do you use to make a game like that

Comment by awesty
2007-05-14 17:31:04

Adobe Flash.

 
 
Comment by Iori400 Subscribed to comments via email
2007-05-24 04:45:24

hello Awesty, I must admit your tutorial helped saved my project..

I have a question..

Say I want the enemy to be a player 2 instead of a punching bag

Could the main code from the MAN movie clip work on the second player

Comment by awesty
2007-07-03 17:38:29

Yes, but you would have to change a few things around.

 
 
Comment by Trunk Monkey
2007-05-24 06:14:25

I still don’t understand how to make the character animate? do you think you could send me the fla or watever of a animation

 
Comment by doug
2007-05-27 05:33:06

i got stuck on code 3and 4

Comment by awesty
2007-07-03 17:38:45

Read the whole tutorial.

 
 
Comment by bob Subscribed to comments via email
2007-06-05 09:45:57

http://www.newgrounds.com/portal/view/382059

used your tutorial and added some stuff to it thx :)

Comment by awesty
2007-07-03 17:42:17

Awesome :D

 
Comment by Izzy Subscribed to comments via email
2007-08-30 11:23:32

I have some things i need help with
1)how do you make him jump
2)duck?
3)i dont know how to make it so that only when the enemy attacks i lose health otherwise he kills me by touching me!
4)how do you make the AI lvl?
or are you just animating them attack you and the computer really isn’t generating any AI lvl.

 
 
Comment by bob Subscribed to comments via email
2007-06-05 09:59:34

sry for double post but how would i use WASD for my attacks, i think one of them is 81? and i think i have to change my ifkey statement?

 
 
Comment by PieR Subscribed to comments via email
2007-06-11 06:27:41

Good tutorial.

But I am having a problem adding another button to make the man crouch. I added another movieclip of him crouching and i tried adding

else if(Key.isDown(Key.DOWN) && fight !=true){
this.gotoAndStop(4);
}
It doesnt give me any Error messages just wont play the movie clip.

Also I cant seem to get the health bar working at all. I took the health bar tutorial also. I dont understand whats wrong with that one!

 
Comment by PieR Subscribed to comments via email
2007-06-11 06:48:20

nevermind about the health bar situation. I figured that out just to have a different problem. I made it so when my hero man runs into the bag he losses health and when the sword hits the bag he losses health but the both lose health and would die at the same time. I have no clue what to do now.

 
Comment by gartman
2007-06-17 06:28:59

how would u make it
that when u get hurt i
put on the hurt animation
_root.man._x += 5
but when u attack from behind it goes the wrong way
>>
__

Comment by awesty
2007-07-03 17:43:47

Make it check which side it is being attacked from.

 
 
Comment by Josue Subscribed to comments via email
2007-06-18 01:31:58

um i have a question, can you set the keys to be preformed on a computer control?

like and PnP control or an xbox 360 control?

and if so how do you do it?

Comment by awesty
2007-07-03 17:44:05

No idea sorry.

Comment by Josue Subscribed to comments via email
2007-07-03 19:36:44

ok well no problem man, listen it seems that you left out parts in your tut, like how to make the life bar decrease from the side instead of the center, and i just cant seem to get the hp bar to stop exactly on 0. it doesnt seem to be on the “life bar” tut, but maybe i missed it on the fighting tut.

Comment by a person
2007-08-08 03:23:43

umm change resastration point
to left (or riight for enemy)

 
 
 
 
Comment by demigod:.eantaru Subscribed to comments via email
2007-07-06 00:08:25

sorry about my english

if u need a source code, just use swf decompiler, dont ask me how can u find it. just googling

here is the swf
http://www.awestyproductions.com/images/

swf decompiler not to plow code but just for learn, hehehehehe

^ ^

 
Comment by Uzi Subscribed to comments via email
2007-07-23 22:29:27

isn’t this ilegal? i tried it to hack dragonfable.com … downloaded the swf with a swf saving program (don’t remember wich… just google) and tried to find out the codes… but… didn’t show much xD

 
Comment by John
2007-07-25 03:39:17

Thanks alot :D
Now all you need to do is make a tutorial for a attacking enemy >:]
Thanks a bunch.
John.

 
Comment by i will Subscribed to comments via email
2007-07-31 04:35:48

my character won’t stop attacking, i put stop on the first frame and name the istance “man” and it just loops, it is weird?
can you help plz?

 
Comment by i willd Subscribed to comments via email
2007-07-31 23:52:39

never mind!!!!!

 
Comment by a person
2007-08-01 09:13:01

how do i make hit reactions

 
Comment by Eric Subscribed to comments via email
2007-08-01 11:29:03

how would i make a character duck

 
Comment by demigod:.eantaru Subscribed to comments via email
2007-08-01 16:56:43

@uzi

no ilegal for education, so dont copy paste the source code for youth engine, just for learn xD

 
Comment by jordan
2007-08-06 01:03:17

Can anyone tell me how to make enemy’s appear and attack the main character (a.k.a. man) because this tutorial does not tell how to do it, it just tells you how to be able to attack the enemy.

 
Comment by jordan