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

570 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 Unmei Subscribed to comments via email
2009-10-26 12:56:08

I’m not sure if it was stated here, but is there a way to make a fighter game with special attacks and the such on flash?

 
 
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 Joe Subscribed to comments via email
2009-07-25 07:53:06

Ok, First… When The Attack Button Is Pressed, You want to make a function activate. So… In the main timeline it will be… ————————— if(KEY.Down(Key.SHIFT)) { gotoAndPlay(\”attack\”); attackmode=true } ————————– And at the top of the timeline: ———————- attackmode = false ———————- So you got attackmode activated only when attack pressed. So you only want damage done to eachother when attackmode is on… So it will be: ————————- if(attackmode && _root.man.hittest(_root.enemy)) { _root.enemyhp-=20} ————————- It should Work fine ;) Hope it helps. I know it\’s a little late but… :p:p:p

 
 
 
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
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
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
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
2007-08-08 07:08:51

how do you create the man movie clip because mine wont work.

 
Comment by jordan
2007-08-09 08:49:50

how do you put all the movie clips into one “man” clip?

 
Comment by Eric Subscribed to comments via email
2007-08-13 04:17:48

i made my character able to duck but when he ducks he always ducks to the right

 
Comment by Eric Subscribed to comments via email
2007-08-13 04:19:50

can you help me?

 
Comment by Ricky
2007-08-18 23:14:40

re:jordan
how do you put all the movie clips into one “man” clip?

====================
well start off by creating a simple box on the screen then convert it to a symbol and make it a movieclip and DONT FORGET TO NAME IT “man”!!

then

delete that box
and
on that first frame on “layer 1″ paste in your “standing” movieclip and on the second frame put in your “walking” movieclip and of coarse on the third frame add in your “fighting” movieclip !

hope this helps! :)

 
Comment by SaroVati Subscribed to comments via email
2007-08-22 03:41:24

Heh, Awesty, on request, I’m making a game for my friend =P Can you please check my coding out? It’s going smoothly but if I hold the attack button (Z) or (90), he just keeps on attacking. Not like looping or anything, if I tap Z, he will just go thru the actions and attack once, but if I hold Z down, he will just stay in the middle of his attack and not move :( I’ve tried using the false and true stuff… but it doesen’t seem to like me :( Lol :P

 
Comment by SaroVati Subscribed to comments via email
2007-08-22 03:42:40

LOL forgot to post my code :P

onClipEvent (load) {
moveSpeed = 5;
fight = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP) && !jumping) {
this.gotoAndPlay(2);
vel_y = 30;
jumping = true;
}
if (jumping == true) {
vel_y -= 2;
if (vel_y

 
Comment by SaroVati Subscribed to comments via email
2007-08-22 03:50:44

Ok my code is too long awesty, lemme e-mail it to you.

 
Comment by ISQ Subscribed to comments via email
2007-08-22 07:24:02

Hey awesty nice tutorial! I got the hang of it pretty fast but I had 1 problem. On your game the character turns while basically staying in the same spot, mine went over 100 pixles. Why is that?

Comment by awesty
2007-09-10 16:54:33

Try putting the registration point in the center of the MC.

 
 
Comment by Tony Subscribed to comments via email
2007-08-27 10:06:56

For some reason, my HP counter won’t decrease when my fighter hits the punching bag at the last frame of hit attacking animation. I’ve checked all the ActionScript codes, and they’re fine…

For the Fighter’s last attacking frame, I put this in a layer above the layer I drew my animations in:

1.) _root.Fighter.gotoAndStop(1);
2.) if (this.hitTest(_root.Punchingbag)) {
3.) _root.HP -= (random(5)+1);
4.) }

I only have Flash 5, so I don’t know if the codes are very different… can someone please help me???

Comment by awesty
2007-09-10 16:56:20

Well the hitTest is probably whats messing it up.

Since you are testing for a MC inside and MC hitting another MC flash deals with it funny.

 
 
Comment by pok1yoyo Subscribed to comments via email
2007-09-01 03:21:43

When I copy this#
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;
#
}
#
}
(i click on movie clip where are all 3 icons,open actions) It make error:

Clipboard Actions: Line 1: Statement must appear within on/onClipEvent handler
1.

Clipboard Actions: Line 7: Statement must appear within on/onClipEvent handler
4.

Clipboard Actions: Line 51: Statement must appear within on/onClipEvent handler
26.

Comment by Izzy
2007-09-01 04:41:45

well i have flash 8 proffessional….and all i did was delete the key code
awesty gives us(for the man with the 3 frames in it) and replace it with that code….then i go and press the
find button…(looks like a magnifying glass) and i type: # in the find box
and nothing in the replace box then click the button that says replace and i
delete all the #’s

then there was no errors

 
 
Comment by Rickyboyce
2007-09-01 08:23:47

re:Comment by ISQ

2007-08-22 07:24:02
Hey awesty nice tutorial! I got the hang of it pretty fast but I had 1 problem. On your game the character turns while basically staying in the same spot, mine went over 100 pixles. Why is that

_____________________________________
well the reason why its doing this is becasue in your man movieclip, the 3 movieclips are wayy off center!
well to fix this you have to go into your man movieclip and move each stickman (walking,standing,attacking) into the middle of the man movieclip where it has that little cross

hope this helps
ricky

 
Comment by ISQ Subscribed to comments via email
2007-09-02 01:19:43

Yeah, it sure does. Thanks a bunch. :)

 
Comment by Rickyboyce
2007-09-09 13:38:49

all good

 
Comment by desperate wannabe flash maker Subscribed to comments via email
2007-09-15 06:13:25

I can’t understand that much
:( I don’t even know about layers and such, and i’m making frame by frame chars but i don’t know how to put them together or where to paint the different moves, mind making a basic tutorial too? :3
One where you explain with pictures maybe? :) I know it takes a lot of time, but i could always ask, right? xD

Else i guess this is kinda great! Good job

Comment by awesty
2007-09-15 10:50:47

There are heaps of tutorials around for that stuff. Just do a quick google search. ;)

 
 
Comment by Robin Subscribed to comments via email
2007-09-20 01:45:37

Could you give me a good tutorial site?

 
Comment by Robin Subscribed to comments via email
2007-09-20 03:18:01

I know this site is good but as long as i’m a total noob it doesn’t help :S I’m the same person as Desperate wannabe flash maker.

 
Comment by Uzi Subscribed to comments via email
2007-09-20 03:27:50

@Robin : try tutorialized[.]com, flashkit[.]com . These should help ;) [just google if these don’t help you]

 
Comment by mr stuck Subscribed to comments via email
2007-09-26 04:32:15

I have read through ALL the comments and tried all the solutions but i seem to have a unique problem… originally i had the looping fight frame, but i changed it to ‘man_mc’ and it worked, except when it stops i cannot start walking or do anything again.

Comment by awesty
2007-09-26 12:04:16

When you renamed it make sure you didn’t miss any in the actionscript.

Comment by mr stuck Subscribed to comments via email
2007-09-26 12:16:35

the actionscripting names are fine, its the fact that it reverts to frame one, which is the stationary stance and that only has stop(); in it, and if i try to copy the actionscripting from the actual man movie clip into frame one (inside him) it gives ahell of alot of errors no matter what i adjust

Comment by awesty
2007-09-26 12:21:31

Well if you only changed the name it shouldn’t have stopped working.

Did you change any part of the script?

Comment by mr stuck Subscribed to comments via email
2007-09-26 12:28:31

originally i had the stop player or whatever script that you put up, bu that just kept on looping the attack, so i copied the script _parent.gotoAndStop(1);
now he stops looping but after hes done attacking you cant do anything with him anymore, he just stands there

(Comments wont nest below this level)
Comment by awesty
2007-09-26 12:37:37

Maybe just email it to me.

 
Comment by mr stuck Subscribed to comments via email
2007-09-26 12:41:16

what adress please (also do you have msn)

 
Comment by awesty
2007-09-29 14:41:04

pasta.on.muppets [ @ ] gmail [ . ] com

 
 
 
 
 
 
Comment by Robin Subscribed to comments via email
2007-09-29 01:47:03

Hmm…
Awesty, when i start up my “game” it says there’s an error with ‘OnClipEventLoad’:
**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

Comment by atnotomus
2007-09-29 05:15:45

put it on the movieclip…

 
 
Comment by Robin Subscribed to comments via email
2007-09-29 01:47:58

Is this supposed to happen? Everything works and such but it’s annoying getting it if it shouldn’t be there.

 
Comment by Robin Subscribed to comments via email
2007-10-06 04:34:27

Wohoo! I fixed the game!
Just one question. If i press enter inside my game it skips forward one frame… Is that supposed to happen? Or is it just something made easy for the program and it will be gone as i put up the finished product on the web?

Comment by awesty
2007-10-06 11:29:55

Thats just because Enter is the shortcut in flash for play. It won’t happen to the finished product.

When you test your menu if you click on ‘Control’ (I think) and then make sure ‘Disable Keyboard Shortcuts’ is unchecked it shouldn’t happen.

 
 
Comment by please help Subscribed to comments via email
2007-10-14 15:47:31

Everything works perfectly except walking left.
Sorry if you’ve already answered this question a million times but there was too many questions and I got tired of reading them.
The tutorials great. Thanks man :)

Comment by please help Subscribed to comments via email
2007-10-14 17:04:54

I am fairly sure that it’s the same problem everyone else is having with the ‘registration point” but I do not know what this is or how to alter its positioning/the positioning of things around it.
I tried to alter the script so that it would simply move th guy 100 pixels to the left and bypass the problem by altering the actionscript for walking left
this._x -= 4;
this._xscale = -100;
this._x = -100;
this.gotoAndStop(2);
However the man moves 100 pixels too far and then cannot move again, left or right. If I new about registration points this probably wouldn’t be a problem. :)

 
 
Comment by please help Subscribed to comments via email
2007-10-14 19:30:52

Also It would be great if you could tell me how to make my guy duck because I tried this
else if(Key.isDown(Key.DOWN) && fight !=true){
this.gotoAndStop(4);
}
}else{
this.gotoAndStop(1);
}

}
The positioning (spaces,these things->{} and lines) might be a bit wrong but thats because it got mangled when I copied and pasted.
Adding this just makes him slide around in idle and it doesent work.
Any tips/solutions?

Comment by please help Subscribed to comments via email
2007-10-15 22:15:46

I fixed the walking left problem by making a fourth frame under man that is 400 pixels to the right of the normal walking and altered the if key is left gotoandplay2 to a gotoandstop4. Great tutorial.
How would I make a hit test on the side to make the animation goto another frame when man touches it. Cheers again man.
You can get my email address from this so I wont have to post it right?
:)
Sorry for adding so many comments/posts

Comment by awesty
2007-10-16 16:58:04

if(this.hitTest(something)){
this.gotoAndStop(someFrameNumber);
}

 
 
Comment by awesty
2007-10-16 16:52:45

Well make sure it doesn’t interfere with the walking code (which is probably why he is just sliding around).

 
 
Comment by Naruhut Subscribed to comments via email
2007-10-20 11:51:43

How do you make your char attack with two buttons pressed one after the other? For better explanation, two make them shoot their bazooka or something, you would press down then left then spacebar.

Comment by awesty
2007-10-25 22:05:59

Well it would be something like:


step1 = 0;
step2 = 0;
if(Key.isDown(Key.DOWN)){
step1 = 5;
}else if(Key.isDown(Key.SPACE) && step1 > 0){
step2 = 5;
}else if(Key.isDown(Key.LEFT) && step2 > 0){
//Bazooka code
}
step1 > -1 ? step1-=1:0;
step2 > -2 ? step2-=1:0;

If you press down a timer starts, if the timer is greater than zero and you press space another timer starts. If you press left before the last timer stops the bazooka works.

Down the bottom the timers decrease by one.

Obviously you would have to change it to suit your needs.

 
 
Comment by Jeffrey
2007-10-30 08:38:51

What I did on my own was make one mc with all the positions seperated by GotoAndStop(1), and i didnt have any problems. I didnt go into a health bar though, there might be a problem there.

 
Comment by Rickyboyce
2007-10-30 08:42:57

Nice job awtesty!!
and thanks again for giving me this very handfull tutorial!

 
Comment by Senatar Subscribed to comments via email
2007-11-14 13:30:38

Im having trouble with puttng all the movie clips into 1 movie clip:

I have my Idle movie clip, Walking movie clip, and Fighting movie clip. Then I made key frames and pasted each one on a seperate frame:
Timeline____________
Keyframes : 1 2 3

for 1 i pasted my idle, for 2 i pasted my walking, and for 3 i pasted my fighting. but when i go back to 1 i only see my idle. I tried going to 3, and making all 3 of them into a movie clip, and what happends is the 3 are lined up, and when i move them they all move, i cant atk, and its all messed up. Can u help plz?__________

1 2 3
thats how they are set up

 
Comment by Mat Subscribed to comments via email
2007-11-14 13:47:01

Yea same here as senatar, but to explain it more in deapth, i dont know which type of frames to choose, and if i pick normal frames, i cant paste anything on there. On key frames, its just like senatar said. i need help bad! I just dont know HOW to put the movie clips into the frames, and which frames to chose. Once i get it all set up im ok. I already made my clips into a symbol (like modify symbol)- so i have 3 movie clip symbols.
CAN YOU PLEASE EXPLAIN EVERY SINGLE DEATAIL ABOUT WHAT TO DO WITH THEM, like how to get to the things, and how to drag it, and what to do exactly, etc PLZPLZPLZ. youll answer 2 people =)))))))))))))))))

 
Comment by Senatar Subscribed to comments via email
2007-11-15 12:54:30

Ohhhhhhhhhhh i get it! i read some comments

@Mat: you need to press F8 and make a movie clip, like your three ones of standing walking and atking. Now go inside that MC. Right click on the timelines first 3 second thingies and make new keyframes. Now you need to put the standing one on the first keyframe, walkinbg on second, etc. There you go!

PS. I made everything but when i atack the enemys hp goes back up. What do u think i did wrong PLZ? what happends is i hurt my enemy ( i checked the name) and it goes back up right after i hit them

 
Comment by Silviu Vlad
2007-11-18 20:42:11

Hi I made a 2 players characters flash fight, fisrst character is the “enemy” and second character is the “man”, In both symbols , in the first frame is the man/enemy standing idle, in the second frame, he’s walking, in 3rd frame he’s punching, in 4th frame, he’s being hit. Now I want to activate the frame 4 , on enemy, when the health is shrinking , or when the man hits it with the punch(frame3>frame6)(where it’s write “if(this.hitTest(_root.enemy)){
_root.hp -= (random(5) 1);
}” )

 
Comment by Isaac Subscribed to comments via email
2007-11-19 13:22:21

hey how do i make the guy walk make idle and attack? do i tween? or do i make each frame a symbol?

 
Comment by Jared Subscribed to comments via email
2007-11-26 10:07:55

good tut but can you make another tut that explains the
artificial intelligence?
ty <3

 
Comment by Alex Subscribed to comments via email
2007-12-28 07:27:57

Did you use flash 8 or flash5?

Comment by awesty
2007-12-28 10:03:34

8

 
 
Comment by Alex Subscribed to comments via email
2007-12-28 07:30:15

Do i have to make the frames on the movieclip?

Comment by awesty
2007-12-28 09:52:11

Which frames?

 
 
Comment by Cecil
2007-12-31 13:47:28

uhhh I think I did everything right, but when I press space and attack, it shows the attack sequence, but no dmg is beng done to the enemy. The health bar shows up full, shown at 100.

Nice tutorial by the way, everything else is working and looking fine.

 
Comment by Cecil
2007-12-31 14:26:11

Sorry for double posting, but I tried doing the whole tutorial over again step by step, and it still didn’t work. Still the same problem, when I attack the enemy it doesn’t do anything to the health bar or dynamic text box. Is it because I am using Flash MX 2004? Please reply, and thanks

 
Comment by Cecil
2007-12-31 14:39:42

Damn it. I always post a question, and a hour later after screwing around with it, I get it to work. My problem was that I was posting this in the wrong place of the attacking frames:

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

NICE TUTORIAL, THANKS!

 
Comment by Cecil
2007-12-31 14:56:23

errrr I am back again. I don’t want my enemy to have 100 hp, can you make him have less. Or more. This might be useful to other people too :)

Thanks,
Cecil

PS: Yeah, I might figure this one out on my own soon enough anyways……. who knows…

PSS: My hp bar decreases into the middle, it doesn’t decrease right to left (or left to right, whatever your’s is) like your animation does.

Comment by awesty
2007-12-31 15:32:48

To change the enemys HP, the HP code would be like:

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

To get the hp bar to decrease to the left you need its registration point to be on the left (it is that little cross thing).

Comment by Cecil
2008-01-01 06:05:08

well, i see the registration point but I can’t click n drag it. This is probably a easy thing to do I am not just seeing how to do it :( .

Thanks,
Cecil

Comment by awesty
2008-01-01 12:41:44

You need to double click on the movie clip to edit it. Then drag the movieclip, not the registration point so it is not the right spot.

Comment by Cecil
2008-01-01 13:15:02

OHHHHHH. I see that now, thanks Awesty, you rock!

(Comments wont nest below this level)
 
 
 
 
 
Comment by Cecil
2007-12-31 15:31:36

LMAO, I am back for another question (I am full of them, aren’t I?).

The questions I asked in my last comment, I still have NOT figured out. But I ran into another problem. I used the health system tutorial for the “man” who attacks and runs in THIS tutorial.

It worked, BUT BUT BUT, when I attack, it considers that “touching” the enemy, therefore I lose health by attacking. I have no idea how to change the script to make it not do that. Your a friggen genius, (on deviantArt, you said you were only 15, thats amazing, I am 14) so could you figure out how to make it so I don’t lose health when attacking the enemy.

Thanks,
Cecil

Comment by awesty
2007-12-31 15:37:16

Lol, do you have msn? It might be easier that way.

Anyway, I haven’t looked at the code in ages, but there is a hitTest in there that will be something like (obviously not exactly the same):

if(blah.hitTest(blah2)){
health–;
}

That is what decreases the health on touch. Try removing that part.

Comment by Cecil
2008-01-01 06:09:21

hmm I see. I should probably be doing a AI tutorial for my enemy as well. Thanks so much for replying!

Cecil

PS: Uhhhhhhhhhhhhhhhhhhh, nope. :) no MSN :)

 
 
 
Comment by Henderick
2008-01-04 08:00:48

Hey umm I have a question about the health bar thing. When my guy attacks the punching bag the health bar doesnt go down. Plus there is nothing above the health bar either.

Comment by awesty
2008-01-04 15:08:50

Thats not a questions…

 
 
Comment by Luis Felipe
2008-01-13 07:29:48

hey here Awesty, just wanted to congratulate you on these tutorials. For one thing they have helped me understand AS 2.0 much better.

Also for this tutorial every thing’s worked fine and well thanks for making all of these tutorials!

:D

 
Comment by Henderick
2008-01-13 13:28:57

Hey Awesty, I figured out my last problem but now i have another. I made 2 attacks. So if you press z it would do the first attack and if you press x it would do the second. But when i test it and press z or x it didn’t do anything. How do I make make it work? Anyways this is the code I used: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.X)){
this.gotoAndStop(3);
fight = true;
}
if(Key.isDown(Key.Z)){
this.gotoAndStop(4);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}

Comment by awesty
2008-01-13 14:28:06

When you want to check if a letter or number key is down you need to use there key code. So your code should look like this:

if(Key.isDown(88)){
this.gotoAndStop(3);
fight = true;
}
if(Key.isDown(90)){
this.gotoAndStop(4);
fight = true;
}

You can find a list of all the keycodes here:
http://www.awestyproductions.c.....eycode.txt

 
 
Comment by Henderick
2008-01-13 15:11:39

Thanks Awesty! I’m looking forward to more of your tutorials.

 
Comment by Henderick
2008-01-13 15:20:49

Hey Awesty, I have another question, I want to make a game like Bob’s Revenge or Reventure. Its a side-scrolling platform jumping fighting game. Can you post a tutorial of how to make this type of game? This could be useful to others too.

Comment by awesty
2008-01-13 21:35:29

If you read some of the tutorials I have already written that shouldn’t be too hard to figure out :)

 
 
Comment by Henderick
2008-01-14 10:45:44

I looked at your platform jumping tutorial and I inserted the code. He couldn’t jump on platforms. I don’t know if he’s suppose to jump but i did insert a jumping code after the first time it didn’t work. How do I possibly make him jump on platforms? Please leave a message about how to fix this problem.

P.S If you’re wondering why i posted this problem here instead of at the platforming tutorial it didn’t work when i posted it at the platforming tutorial.

Comment by awesty
2008-01-15 19:30:37

You are going to have to modify the two scripts so they work together.

It like cutting to cars in half and then wielding the outsides together. Of course it isn’t going to work unless the modify the insides of each car to fit with the other.

 
 
Comment by Henderick
2008-01-31 08:28:45

Im sorry but that didn’t really answer my question. My question was how do i make make him able to stay on platforms when he jumps on them? My other question is, is he suppose to jump in the code you gave me in the platforming tutorial?

 
Comment by Ben Nolan
2008-03-08 06:52:14

Hey man great tutorials on here, ive just been having problems with my fighting game ive had to tweak ur code a bit becuase i have 2 attack clips but i have a problem, whenever my guy walks over or stands over the punching bag it loses health.. ive fixed it abit but i cant get the other attack to work with the code which i added to the enemy movie clip. it is

onClipEvent(enterFrame){ if(this.hitTest(_root.man.punch)){ _root.hp -= (random(5)+1); } }

it also stil takes off way to much health. i would be really grateful if you could help me with this becuase i want to go on to making a moving AI enemy for the dude to fight against, but i just need this fixed before i head on. I can email u my flash file if you like thanks alot Ben

 
Comment by james Subscribed to comments via email
2008-03-16 20:33:26

about that artificial intelligence (AI) thingey…could you make a tutorial of that because i’m trying to make the enemy attack the player and for the player to have it’s own health bar.

 
Comment by james Subscribed to comments via email
2008-03-16 20:39:45

oh no worry s, i’ve just found the tutorial :) thanks

 
Comment by james Subscribed to comments via email
2008-03-16 21:43:31

oh no i haven’t! they haven’t got health systems, could you help me with this!:(

 
Comment by james Subscribed to comments via email
2008-03-24 00:44:35

please help! BTW my email isn’t working.

 
Comment by SaroVati Subscribed to comments via email
2008-03-24 04:55:14

Lol James Awesty has a health system tutorial on this site as well. Just look that up, and implement it in your game. Awesty’s tutorials are actually really helpful because you can put them in almost anywhere without much problems. Even though I make tile-based games and also use OOP, I still recommend my friends to look at these tutorials because they are easy to understand and help you develop.

 
Comment by james Subscribed to comments via email
2008-03-24 19:15:08

yeah, i agree. i am making a fighting game with two people in; one who you control, and one you fight against, now i have put the health bars in (thanks to you and awesty!) but i can’t get the enemy to run at you or attack you, i went on the AI tutorial and used the code for the follower on my enemy but he stays a certain distance away from you and doesn’t attack. any suggestions or tweaks on the code that might help me!? thanks

Comment by stinkychops Subscribed to comments via email
2008-03-24 20:18:34

maybe you should use the script from the enemy (square guy) instead.

 
 
Comment by james Subscribed to comments via email
2008-03-24 22:14:28

cheers! :D i am now on my way to making a great game, but one more prob, because my enemy is a stickman he only faces one way when i need him to face the man i control. any suggestions!? (BTW if anyone is having trouble with their animations download TISFAT (this is stick figure animation theatre) and from there export it to flash).

Comment by stinkychops Subscribed to comments via email
2008-03-25 10:04:38

I cant remember without seeing the exact script but what you need to do is
Under the if statement that makes him move right
(rb >=-10 or something)
put this on the end (before the closing })
this._xscale=-100

under the one that moves left you need to put
this._xscale=+100
this will stuff up if you’ve messed around with scale after making it an mc, hope this helps.

Comment by james Subscribed to comments via email
2008-03-29 04:31:39

this is the script:
onClipEvent (enterFrame) {
tx = this._x;
mx = _root.man._x;
rx = tx-mx;
if (this.hitTest(_root.man)) {
this.gotoAndStop(2);
} else {
if (rx>=1 && rx<300) {
this._x -= 1;
}
if (rx-300) {
this._x += 1;
}
this.gotoAndStop(1);
}

Comment by stinkychops Subscribed to comments via email
2008-03-29 10:57:47

well, this might get cutoff because i’ll try to use the greater than sign
heres what you need to do

onClipEvent (enterFrame) {
tx = this._x;
mx = _root.man._x;
rx = tx-mx;
if (this.hitTest(_root.man)) {
this.gotoAndStop(2);
} else {
if (rx>=1 && rx=-300 && rx<=1) {
this._x += 1;
}
this.gotoAndStop(1);
}

im relatively sure thats wat you need to do, please make sure the mc you are using starts at scale 100

Comment by SaroVati Subscribed to comments via email
2008-03-29 11:05:04

Wow I hope you guys relieze you’re way off lol. Are you guys just copying and pasting code then changing random things? Read your own code over….. it says:

if (rx>=1 && rx <=1) {

Sigh thats like saying if ‘x’ equals 1 and ‘x’ doesent equal one, then….
See how it makes 0 sense? Rofl that code is screwed over. And if you have problem with the distance, change the codes number from 300 to larger, and keep the same code Awesty gave you because this code will do nothing lol.

(Comments wont nest below this level)
 
 
 
 
 
Comment by stinkychops Subscribed to comments via email
2008-03-29 19:15:13

actually you are incorrect
rx is an equation and therefore i am saying if objects a distance from object b is greater than 1 but less than 200 pixels away i will move towards him.
It has little to do with the exact co-ordinates of an object as you suggested.
whilst you are correct that his code, which i foolishely copied and pasted without checking was incorrect, the point i was making is that he needs to do this
if (rx>=1 && rx<200) {
this.gotoAndStop(2);
this._x -= 5;
this._xscale = -100;
}
also he is asking how he can get a 2d figure to change the way he is facing nothing to do with distances.
btw the code he used would have moved the enemy just incorrectly.
Please understand what people are talking about before attempting to correct them.

 
Comment by SaroVati Subscribed to comments via email
2008-03-30 02:45:10

Lol sigh, can you please read your other comment? The code on it has nothing to do with the code he gave you but sure…. All I was saying was that the code provided wouldn’t work, and it wouldn’t have said any syntax errors so it would have been very confusing for his game to not work…. And for the understanding, on your code u provided that I replied to, you have NOTHING on xscale on it, so how is that relavent? Just saying lol.

 
Comment by james Subscribed to comments via email
2008-03-30 02:52:13

So what IS the code SaroVati! lol

 
Comment by SaroVati Subscribed to comments via email
2008-03-30 03:00:50

It’s the same code Awesty gave you, just added new stuff, ill put it in:

onClipEvent(enterFrame){
tx = this._x;
mx = _root.man._x;
rx = tx - mx;
if(this.hitTest(_root.man)){
this.gotoAndStop(2);
}else{
if(rx >= 1 && rx<300){
this._x -= 5;
this._xscale = 100;
}
if(rx <= -1 && rx<-300){
this._x = 5;
this._xscale = -100;
}
this.gotoAndStop(1);
}
}

 
Comment by james Subscribed to comments via email
2008-03-30 03:09:26

doesn’t work; the enemy will face right and move right but won’t face or move left.

 
Comment by james Subscribed to comments via email
2008-03-30 03:10:12

actually other way around! lol

 
Comment by SaroVati Subscribed to comments via email
2008-03-30 03:13:16

Ugh… haha the ‘prevent-hacking’ system screws alot of codes up doesent it Awesty? :P Well the problem is in the ‘this._xscale = 100;’ code… Kinda got reversed, so have the first one has -100 and the 2nd one as 100.

 
Comment by stinkychops Subscribed to comments via email
2008-03-31 17:48:36

what the hell happened to my new comment???

 
Comment by Lolux Subscribed to comments via email
2008-04-23 23:34:33

I am so very very sorry I didn’t put my email but I have a fear of internet pervs. Enough on me but I don’t get the punch thing, if I don’t put the code it loops, if I DO put the code i cant punch. HELLLP!

Lolux xx

Comment by stinkychops Subscribed to comments via email
2008-04-24 12:59:22

well you need to re-read the tutorial, check your instance names, put the script in the correct spot, check where you’ve put your stop(); AS and if that doesent fix it be more specific.

 
 
Comment by Kathran Smith Subscribed to comments via email
2008-05-10 12:47:32

I’m so happy to make my own game.

 
Comment by mapoga Subscribed to comments via email
2008-07-27 13:55:17

Hey I just wanted to say thanks, your help is very appreciated. It’s Hard to find good tuto and well explained as yours on the web. Most of all are lacking in information or for non-beginners(wich I am). So It’s hard to find a good tuto that will help you launch into game devloping. With that I think I will have enough informations to make my first entirely created game. I know how time-consuming tuto must be to do, but if you have some free time, it would be great if you could add some others.

Thanks again

 
Comment by ben569 Subscribed to comments via email
2008-08-01 11:18:59

what do i need to make this game

 
Comment by stinkychops Subscribed to comments via email
2008-08-01 22:05:26

Macromedia Flash 4 or greater

 
Comment by me
2008-08-14 06:59:50

this game is boring

Comment by you
2008-08-14 20:01:07

no it isn’t

 
 
Comment by FlashKit Lover Subscribed to comments via email
2008-09-05 04:57:44

I am running Flash MX, how do i make the 3 frames to use the ONLY one MC? PLease help!

 
Comment by OnlineFlash Subscribed to comments via email
2008-09-10 01:37:33

Can you add a source file as i got some of it wrong?

 
Comment by k1rly
2008-09-26 03:00:11

i got stuck when you tell me to put all the clips into one clip how do we

 
Comment by Zack Subscribed to comments via email
2008-09-28 04:02:33

I looked in the comments I didn’t see anything that answered my question… Is there a way to make the enemy hurt you?

 
Comment by filbert
2008-10-15 06:24:03

What does it mean, “put them all into one movie clip?” They’re already separate movie clips, right? Wrong, probably.

 
Comment by Stinkychops Subscribed to comments via email
2008-10-17 21:57:36

I think he means how does he place the 3 mc’s inside the containing mc.

Just make an mc, double click on it, put 3 keyframes down and then put 3 mc’s in theses frames.

 
Comment by shadow982 Subscribed to comments via email
2008-12-09 15:22:31

hello, and i did everything you said, but, my attack thing loops, i even have the stop(); and it still loops!, could you please email me at dragon982@hotmail.com and send me a source file of your creation and so i can correct mine? please, and thank you.
and if you think i’m going to say its mine, just send me the man movieclip and i would be very happy, please respond as soon as you can, i’ve been trying to make a fighting game for a long time. thanks!

 
Comment by jemar Subscribed to comments via email
2008-12-19 07:53:12

how do i even draw a stick man or make him move like i cant edit him or it to make him move can i i no timelines and stuff but how do i make him move

 
Comment by Henderick
2009-01-11 05:26:08

START_!&!%,*$*,0,0.858525394000083,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,3,2,52612,1,27,0,0,0,50,475,100,160,144,*$*,EMPTY,10,13,9,10,14,0,0,0,0,0,0,0,0,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,2,2,2,2,2,2,*^*,436,436,436,415,427,451,451,461,*^*,478,479,461,477,451,437,463,436,430,427,416,415,400,*^*,NODATA,*^*,1,0,0,4,1,0,0,2,1,3,0,1,5,1,0,0,4,5,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,400,0,0,415,416,0,0,427,430,436,0,463,0,437,0,0,451,0,0,0,477,0,461,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,319,320,316,318,317,647,351,352,354,350,353,647,548,549,551,550,552,601,355,357,359,356,358,506,369,365,366,367,368,523,0,*^*,0,1,2,3,-1,-1,*^*,27,26,26,23,12,12,*^*,642,643,644,645,646,602,0,*^*,38,34,36,35,37,39,0,*^*,364,363,362,361,360,522,0,*^*,627,628,629,630,631,651,652,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,98,0,0,0,*^*,0,0,0,0,82,0,0,0,*^*,0,0,0,89,0,0,0,0,*^*,397,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,198,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,116,38,397,121,0,*^*,9,12,11,9,0,*^*,46,49,20,50,0,*^*,0,84,0,105,25,*^*,0,0,0,0,0,*^*,2,1,*^*,18.4423298657627,98.253019065615,22.0896392933853,76.099962700132,0,0,*^*,2,4,32,71,2,4,*$*,0,6.00967775800058,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,21,14,368284,7,189,0,0,0,350,3325,700,1120,1008,*$*,EMPTY,70,91,63,70,98,0,0,0,0,0,0,0,0,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,14,14,14,14,14,14,*^*,3052,3052,3052,2905,2989,3157,3157,3227,*^*,3346,3353,3227,3339,3157,3059,3241,3052,3010,2989,2912,2905,2800,*^*,NODATA,*^*,7,0,0,28,7,0,0,14,7,21,0,7,35,7,0,0,28,35,0,0,7,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,2800,0,0,2905,2912,0,0,2989,3010,3052,0,3241,0,3059,0,0,3157,0,0,0,3339,0,3227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,2233,2240,2212,2226,2219,4529,2457,2464,2478,2450,2471,4529,3836,3843,3857,3850,3864,4207,2485,2499,2513,2492,2506,3542,2583,2555,2562,2569,2576,3661,0,*^*,0,7,14,21,-7,-7,*^*,189,182,182,161,84,84,*^*,4494,4501,4508,4515,4522,4214,0,*^*,266,238,252,245,259,273,0,*^*,2548,2541,2534,2527,2520,3654,0,*^*,4389,4396,4403,4410,4417,4557,4564,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,686,0,0,0,*^*,0,0,0,0,574,0,0,0,*^*,0,0,0,623,0,0,0,0,*^*,2779,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,1386,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,812,266,2779,847,0,*^*,63,84,77,63,0,*^*,322,343,140,350,0,*^*,0,588,0,735,175,*^*,0,0,0,0,0,*^*,14,7,*^*,129.096309060339,687.771133459305,154.627475053697,532.699738900924,0,0,*^*,14,28,224,497,14,28,*$*,7,*$*,!&!%_END sorry

 
Comment by Henderick
2009-01-11 08:14:32

START_!&!%,*$*,0,0.859259999999978,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,5,2,69127,1,30,0,0,0,65,560,100,125,153,*$*,EMPTY,10,13,9,10,14,0,0,0,0,0,0,0,0,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,2,2,2,2,2,2,*^*,436,436,436,415,427,424,451,477,*^*,478,479,461,477,451,437,463,475,436,430,427,424,420,416,415,400,*^*,NODATA,*^*,1,0,0,4,1,1,1,2,1,3,1,1,5,1,0,0,4,5,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,400,0,0,415,416,420,424,427,430,436,475,463,0,437,0,0,451,0,0,0,477,0,461,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,364,0,361,362,360,522,38,34,35,36,37,39,319,320,316,318,317,647,548,549,551,550,552,601,355,357,359,356,358,506,369,365,366,367,368,523,620,*^*,0,1,2,3,-1,-1,*^*,30,30,30,23,12,12,*^*,642,643,644,645,646,655,0,*^*,632,633,634,635,636,647,0,*^*,617,363,619,620,621,647,0,*^*,627,628,629,630,631,651,652,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,81,0,81,0,0,81,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,397,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,198,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,119,50,463,76,0,*^*,99,105,214,118,0,*^*,122,135,115,106,0,*^*,0,84,0,105,25,*^*,0,0,0,0,0,*^*,2,1,*^*,94.7155905385125,0.157766276637673,99.0676753319822,76.099962700132,0,0,*^*,2,4,32,71,2,4,*$*,0,6.01481999999985,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,35,14,483889,7,210,0,0,0,455,3920,700,875,1071,*$*,EMPTY,70,91,63,70,98,0,0,0,0,0,0,0,0,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,14,14,14,14,14,14,*^*,3052,3052,3052,2905,2989,2968,3157,3339,*^*,3346,3353,3227,3339,3157,3059,3241,3325,3052,3010,2989,2968,2940,2912,2905,2800,*^*,NODATA,*^*,7,0,0,28,7,7,7,14,7,21,7,7,35,7,0,0,28,35,0,0,7,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,2800,0,0,2905,2912,2940,2968,2989,3010,3052,3325,3241,0,3059,0,0,3157,0,0,0,3339,0,3227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,2548,0,2527,2534,2520,3654,266,238,245,252,259,273,2233,2240,2212,2226,2219,4529,3836,3843,3857,3850,3864,4207,2485,2499,2513,2492,2506,3542,2583,2555,2562,2569,2576,3661,4340,*^*,0,7,14,21,-7,-7,*^*,210,210,210,161,84,84,*^*,4494,4501,4508,4515,4522,4585,0,*^*,4424,4431,4438,4445,4452,4529,0,*^*,4319,2541,4333,4340,4347,4529,0,*^*,4389,4396,4403,4410,4417,4557,4564,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,567,0,567,0,0,567,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,2779,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,1386,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,833,350,3241,532,0,*^*,693,735,1498,826,0,*^*,854,945,805,742,0,*^*,0,588,0,735,175,*^*,0,0,0,0,0,*^*,14,7,*^*,663.009133769587,1.10436393646371,693.473727323875,532.699738900924,0,0,*^*,14,28,224,497,14,28,*$*,7,*$*,!&!%_END

I am soo sorry, I have no where else to send it besides email and forums.
(These are comments, not forums btw)

 
Comment by Henderick
2009-01-11 09:54:37

START_!&!%,*$*,0,0.859259999999978,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,5,2,72499,1,30,0,0,0,65,560,100,125,153,*$*,EMPTY,10,13,9,10,14,0,0,0,0,0,0,0,0,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,2,2,2,2,2,2,*^*,436,436,436,415,427,424,451,477,*^*,478,479,461,477,451,437,463,475,436,430,427,424,420,416,415,400,*^*,NODATA,*^*,1,0,0,4,1,1,1,2,1,3,1,1,5,1,0,0,4,5,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,400,0,0,415,416,420,424,427,430,436,475,463,0,437,0,0,451,0,0,0,477,0,461,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,364,363,361,362,360,522,38,34,35,36,37,39,319,320,316,318,317,647,548,549,551,550,552,601,355,357,359,356,358,506,369,365,366,367,368,523,620,*^*,0,1,2,3,-1,-1,*^*,30,30,30,23,12,12,*^*,642,643,644,645,646,655,0,*^*,632,633,634,635,636,647,0,*^*,617,618,619,620,621,647,0,*^*,627,628,629,630,631,651,652,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,81,0,81,0,0,81,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,397,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,198,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,119,50,463,76,0,*^*,99,105,214,118,0,*^*,133,151,129,118,0,*^*,0,84,0,105,25,*^*,0,0,0,0,0,*^*,2,1,*^*,94.7155905385125,0.157766276637673,99.0676753319822,76.099962700132,0,0,*^*,2,4,32,71,2,4,*$*,0,6.01481999999985,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,35,14,507493,7,210,0,0,0,455,3920,700,875,1071,*$*,EMPTY,70,91,63,70,98,0,0,0,0,0,0,0,0,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,14,14,14,14,14,14,*^*,3052,3052,3052,2905,2989,2968,3157,3339,*^*,3346,3353,3227,3339,3157,3059,3241,3325,3052,3010,2989,2968,2940,2912,2905,2800,*^*,NODATA,*^*,7,0,0,28,7,7,7,14,7,21,7,7,35,7,0,0,28,35,0,0,7,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,2800,0,0,2905,2912,2940,2968,2989,3010,3052,3325,3241,0,3059,0,0,3157,0,0,0,3339,0,3227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,2548,2541,2527,2534,2520,3654,266,238,245,252,259,273,2233,2240,2212,2226,2219,4529,3836,3843,3857,3850,3864,4207,2485,2499,2513,2492,2506,3542,2583,2555,2562,2569,2576,3661,4340,*^*,0,7,14,21,-7,-7,*^*,210,210,210,161,84,84,*^*,4494,4501,4508,4515,4522,4585,0,*^*,4424,4431,4438,4445,4452,4529,0,*^*,4319,4326,4333,4340,4347,4529,0,*^*,4389,4396,4403,4410,4417,4557,4564,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,567,0,567,0,0,567,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,2779,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,1386,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,833,350,3241,532,0,*^*,693,735,1498,826,0,*^*,931,1057,903,826,0,*^*,0,588,0,735,175,*^*,0,0,0,0,0,*^*,14,7,*^*,663.009133769587,1.10436393646371,693.473727323875,532.699738900924,0,0,*^*,14,28,224,497,14,28,*$*,7,*$*,!&!%_END
sorry, this is the last one tho

 
Comment by Henderick
2009-01-11 11:52:41

START_!&!%,*$*,0,0.859259999999978,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,5,2,82087,1,30,0,0,0,65,560,100,125,153,*$*,EMPTY,10,13,9,10,14,0,0,0,0,0,0,0,0,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,25,88,78,55,*^*,2,2,2,2,2,2,*^*,436,436,436,415,427,424,451,477,*^*,478,479,461,477,451,437,463,475,436,430,427,424,420,416,415,400,*^*,NODATA,*^*,1,0,0,4,1,1,1,2,1,3,1,1,5,1,0,0,4,5,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,400,0,0,415,416,420,424,427,430,436,475,463,0,437,0,0,451,0,0,0,477,0,461,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,364,363,361,362,360,522,38,34,35,36,37,39,319,320,316,318,317,647,548,549,551,550,552,601,0,0,0,0,0,0,369,365,366,367,368,523,620,*^*,0,1,2,3,-1,-1,*^*,30,30,30,23,12,12,*^*,642,643,644,645,646,655,0,*^*,632,633,634,635,636,647,0,*^*,617,618,619,620,621,647,0,*^*,627,628,629,630,631,651,652,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,81,0,81,0,0,81,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,397,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,198,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,119,50,463,76,0,*^*,99,105,214,118,0,*^*,133,151,129,118,0,*^*,0,84,0,105,25,*^*,0,0,0,0,0,*^*,1,2,*^*,94.7155905385125,0.157766276637673,99.0676753319822,76.099962700132,0,0,*^*,2,4,32,71,2,4,*$*,0,6.01481999999985,undefined,undefined,undefined,HIGH,true,true,true,HPCI.01,35,14,574609,7,210,0,0,0,455,3920,700,875,1071,*$*,EMPTY,70,91,63,70,98,0,0,0,0,0,0,0,0,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,175,616,546,385,*^*,14,14,14,14,14,14,*^*,3052,3052,3052,2905,2989,2968,3157,3339,*^*,3346,3353,3227,3339,3157,3059,3241,3325,3052,3010,2989,2968,2940,2912,2905,2800,*^*,NODATA,*^*,7,0,0,28,7,7,7,14,7,21,7,7,35,7,0,0,28,35,0,0,7,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,2800,0,0,2905,2912,2940,2968,2989,3010,3052,3325,3241,0,3059,0,0,3157,0,0,0,3339,0,3227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,0,0,0,0,TENACITY5,0,0,0,0,CHARGEDBLOOD5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*^*,2548,2541,2527,2534,2520,3654,266,238,245,252,259,273,2233,2240,2212,2226,2219,4529,3836,3843,3857,3850,3864,4207,0,0,0,0,0,0,2583,2555,2562,2569,2576,3661,4340,*^*,0,7,14,21,-7,-7,*^*,210,210,210,161,84,84,*^*,4494,4501,4508,4515,4522,4585,0,*^*,4424,4431,4438,4445,4452,4529,0,*^*,4319,4326,4333,4340,4347,4529,0,*^*,4389,4396,4403,4410,4417,4557,4564,*^*,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,*^*,0,0,567,0,567,0,0,567,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,2779,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,1386,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,0,0,0,*^*,0,0,0,0,0,*^*,833,350,3241,532,0,*^*,693,735,1498,826,0,*^*,931,1057,903,826,0,*^*,0,588,0,735,175,*^*,0,0,0,0,0,*^*,7,14,*^*,663.009133769587,1.10436393646371,693.473727323875,532.699738900924,0,0,*^*,14,28,224,497,14,28,*$*,7,*$*,!&!%_END

 
Comment by Henderick
2009-01-11 11:53:33

The only reason why I added another one, is because the last 2 didn’t work. ^^^^^^
Sorry.

 
Comment by sachin Subscribed to comments via email
2009-03-28 17:48:56

Hey I did everything,but it still loops in the kick movie.
i put _root.man.gotoAndPlay(1);
and gotoAndStop(1);!

 
Comment by pancho pistolas Subscribed to comments via email
2009-04-06 11:04:47

how i do to the character goes faster by exemple when i press “G” and “Rigth” at the same time???

 
Comment by Adam Subscribed to comments via email
2009-04-12 19:47:14

Won’t work!

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 26: Statement must appear within on/onClipEvent handler
stop();

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

Total ActionScript Errors: 2 Reported Errors: 2

 
Comment by hello i need help awesty
2009-04-15 09:48:18

have this problems:
** Error ** Scene = Scene 1, layer = Layer 1, frame = 1: Line 39: Syntax error.
F (Key.isDown (Key.SPACE)) (

** Error ** Scene = Scene 1, layer = Layer 1, frame = 1: Line 35: The statement block must end with ‘)’
) else if (Key.isDown (Key.RIGHT) & & fight! = true) (

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

** Error ** Scene = Scene 1, layer = Layer 1, frame = 1: Line 30: The block declaration must end with ‘)’
if (fight == false) (

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

** Error ** Scene = Scene 1, layer = Layer 1, frame = 1: Line 29: The block statement must end with ‘)’
onClipEvent (enterFrame) (

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

Total ActionScript Errors: 7 errors reported: 7
> cambiar
its in spanish but i translate to english help please

Comment by Joe Subscribed to comments via email
2009-07-25 07:59:19

Errmm, Count the brackets, and end them…
You also Put

F (Key.isDown (Key.SPACE)) (

instead of

if(Key.isDown (Key.SPACE)) (

 
 
Comment by You Subscribed to comments via email
2009-05-10 00:40:21

Haelo i r teh neu hear an i wan tew sai taht i laff yer videaos an taht leik tatorials i lafff dem pleaz geive me awl yer manneh me laff yer diack penis penis dick dick penis vagina vajayjay penis pe pe in jay jay

 
Comment by Fletch
2009-05-11 05:58:25

ok ive followed this tutorial and fixed any bugs that i had except one, which i don’t understand how to fix, please help me, what happens is that when i export the movie clip it will attack fine but when i move the character it shrinks to half its origional width and stays at half width even when i attack. so basically it gets alot thinner when i move, i dont know why this happens and i need to fix it, thankyou for reading and please help!

 
Comment by James Subscribed to comments via email
2009-07-09 16:03:10

How would I make a second character controlled with W,A,S,D? I want to make a 2p fight game.

 
Comment by joe Subscribed to comments via email
2009-07-15 02:24:48

WAIT! I AM SO CONFUSED! you gave us like a million codes!
QUOTE: “Now return to the main timeline and click on you ‘man’ movieclip and put these actions on it.” by these, do you mean like EVERY FREAKIN CODE you gave us from that point down?

Comment by Stinkychops Subscribed to comments via email
2009-07-18 12:56:07

THESE! THESE!
DON’T YOU KNOW WHAT THE WORD THESE MEANS!

WHY DON’T YOU JUST TRY IT AND SEE IF IT WORKS?

Comment by joe Subscribed to comments via email
2009-07-18 14:19:47

WHY THE HELL ARE YOU SO MAD?!?!?!?!?

Comment by stinkychops Subscribed to comments via email
2009-10-26 18:38:31

I was joking, but uh, when he says these he either means unassigned script or the following script. Mess around with it a little and tell me how you go.

 
 
 
 
Comment by jack Subscribed to comments via email
2009-07-15 05:25:05

wait, so i just created a battle, how do i make a character select screen and like a stage select screen and a two player mode how do i do all that?

Comment by Stinkychops Subscribed to comments via email
2009-07-18 12:51:50

Use some goddamn initative.

Put another frame in the main timeline, and add button MC’s.
Program the buttons with
on(press){
gotoAndStop(#)
}
change the number to whatever you want.
Learn yourself!

Comment by jack Subscribed to comments via email
2009-07-18 14:11:32

sorry, i didnt read the action scripts >.< you really made me feel stupid you know. . .

 
Comment by jack Subscribed to comments via email
2009-07-18 14:15:48

hey, can you tell me a place that tells you action scripts and what they mean so i wouldnt ask stupid questions like this? that way i would find those codes, because i havent memorized any action script and i dont know what any of it means

 
Comment by jack Subscribed to comments via email
2009-07-18 14:18:44

oh, and another thing, does that mean i have to make a different frame for every character combined with every enemy in the battles? ie: man one vs man 1 would take me to frame 1, man one vs man 2 would take me to frame 2, and one more thing, how do i give the computer intellegence so he attacks>

Comment by stinkychops Subscribed to comments via email
2009-10-26 18:36:22

Uh depends how you want to program it. Your idea is the easiest method, but not really the best.

I don’t imagine you are completely competant with variables, add+removes so I’d recommend your method.

If you’d like to learn variables and add + removes I can help you with that.

Sorry about my previous demeanor; it seems as if people do not follow the instructions and lazily chop up the script.

 
 
 
 
Comment by jack Subscribed to comments via email
2009-07-15 05:51:49

also, how do i make more than one attack?and lastly, i would greatly appreciate it if you were to guide me through making transformations for the characters

Comment by Stinkychops Subscribed to comments via email
2009-07-18 12:54:32

If you can’t understand what the script means, you shouldn’t go around copy pasting it.
Actually read and comprehend the tut before commenting.

Think about it.
You want a new attack, put in a new key comman.
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(4);
}
You’ll have to actually animate the move though, something I won’t help you with.

 
 
Comment by judy Subscribed to comments via email
2009-09-08 03:43:07

help please!!! i didnt draw stickmen but i used sprites i made stand walk punch/kick i got help from my brother and we followed the instructions(maybe since i didn’t do it) but when we do punch on the test movie(the mario punch has 3 frames) the punch it only does 2 frames adn the punch has 3 what happend O.o??? Did he do someting wrong or anything( cant explain how my brother did it i wasnt watchging :P).

Comment by stinkychops Subscribed to comments via email
2009-10-26 18:31:33

He put the script for the _root.man.gotoAndStop(1)
in the 3rd frame. Make a 4th frame with mario standing still and place the script from the 3rd frame into it. Removing the script from the 3rd frame.

 
 
Comment by Jamie Subscribed to comments via email
2009-11-11 12:29:28

How do you make a single frame movieclip. The tutorial says to put each movieclip of the man standing, walking and attacking one frame each?

Please Help! I’d be so happy if i could make that fighting game

Comment by stinkychops Subscribed to comments via email
2009-11-11 12:39:14

Create a MC.
Double click it.
You are now inside the MC.
Right click the timeline
Insert keyframe
Press the blue arrow to leave the MC.

 
 
Comment by Jamie Subscribed to comments via email
2009-11-11 12:33:04

Also does anyone know how to make a 2 player fight game? or a link
besides the one at Tutcity.

Thank alot.

Comment by stinkychops Subscribed to comments via email
2009-11-11 12:46:17

Are you talking about on one keyboard or across the internet?

 
 
Comment by Jamie Subscribed to comments via email
2009-11-11 17:10:42

On one keyboard. All the tutorials are not very good for making 2 player stick fighting games. THis sites pretty helpful but I just need a straightforward tutorial. I’m not very good with flash. How do you use this tutorial to make actual games. Do you have to make up the code.

THanks for even looking at this question. I know it is pretty stupid.

 
Comment by Jake
2009-11-12 10:18:07

When it says put each movieclip of the man standing, walking and attacking onto one frame each, do you insert keyframes or frames.

Comment by stinkychops Subscribed to comments via email
2009-11-12 14:15:05

Keyframes.

A frame means that whatever is in the pre-exisitng keyfram will be repeated for a duration of time (dependant on fps). Altering whats in a frame alters all the frames beore and after it up until a keyframe.

As for your other question.

You’ll want to map the walking back and forth functions for player one to ‘a’ and ‘d’ and jumping to s. Perhaps have attcks with ‘c’ and ‘v’.

then have another player controlled by arrow keys and using keypad to fight.

To do this put create two fighters and shove the normal script in one (with the attacks set to say keypad’0′ and ‘1′) and the altered script in another.

I can’t remember what numbers represent all the indivual keys. Search for the keyCommands flash for keyboard on google or soemthing.

Hope that helps/

 
 
Comment by Jamie Subscribed to comments via email
2009-11-14 09:26:28

Thanks alot.

SO am I right to insert a keyframe when it says in the tutorial to add frames?

Is there a list on the internet of all the actionsrict coz I don’t know where you guys learn there code. HOw do you know when to put”;” or “}” or “)” or any of those funny symbols.

I don’t understand.

Comment by stinkychops Subscribed to comments via email
2009-11-14 13:38:55

Don’t bother yourself with ‘;’, when you are finished typing pressing the series of lines at the top of the script will format it correct.
‘}’ is very simple, wherever you see a { symbol means it is the beginning of a funtion. when that particular job is done. For example an ‘if’ command, you need to end the function with a }.
So the handler
onClipEvent(enterFrame){
contains all the script for the MC and when there is no more to be run through, you place a }.
A simple way of checking is simply to count all the open { and all the close }.

Whereas brackets are even more simple. I assume you get errors saying bracket expected or some such.
For example
if(Key.isDown(Key.RIGHT)){

Read the statement in reverse. if The Right Key is down. So again you count the number of open brackets and place the number close brackets.

Perhaps it would be easier if you uploaded your work to;
www.spamtheweb.com and allowed me to have a look at it. (Upload the fla not the swf)

 
 
Comment by Jamie Subscribed to comments via email
2009-11-14 09:29:41

By the way thanks StinkyChops. Youre awesome.

 
Comment by THEOBLITERATOR
2009-11-14 10:21:53

AWESTY. Please make part two!

Comment by stinkychops Subscribed to comments via email
2009-11-14 13:40:57

Perhaps you could make part two by viewing his simple ai tutorial and expanding upon it with some random functions and counts.

 
 
Comment by Mislav Subscribed to comments via email
2010-02-26 05:05:26

Stupid!

Comment by stinkychops Subscribed to comments via email
2010-03-01 00:00:18

no u
Whats the issue?

 
 
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> in your comment.