This tutorial will teach you how to make a fighting
game. First Create a Menu for your game, then
you will know in wich frames will you make fighting engine end
everything else. So let's start with
simple menu.
So now when we have the Menu part over and codes set for buttons.
Let's go on frame 2(don't forget to put stop()
on frames)and start making Fight engine. First we will make a
character(click this if
you need help with characters).
1. Draw your character and convert him to Movie Clip (Select him
and press F8)
2. Edit him and give him Frames for every action, one frame for
Punch, one for Kick
(standing still and walking are in frame 1 so make 3 frames for
now and convert character in every frame to MC)
3. Make animations for every frame of character, make standing
in [char mc (edit) chars first frame (edit)]
first frame then walk animation from frame 2 and don't forget
to put "stop();" in every first frame of every MC.
Also make punch in [char mc (edit) chars second frame (edit)]
and animation for kick in [char mc (edit) chars third
frame (edit)]
4. Codes
give our character instance name; char
then give him this codes
onClipEvent(load)
{
var fight=false;
}
onClipEvent(enterFrame)
{
if(fight==false){
//codes for movement
if(Key.isDown(Key.RIGHT))
{
_x+=5;
_xscale=100;
}
if(Key.isDown(Key.LEFT))
{
_x-=5;
_xscale=-100;
}
}
this codes in kick Movie Clip(edit char then click on MC in third
frame and open AS)
onClipEvent(enterFrame)
{
if(Key.isDown(Key.SHIFT))
this.play();
}
and add this codes in last frame of kick animation (edit char
then edit MC in third frame click on last frame and
open AS)
Artificial Inteligence will be in other Tutorial so I'll explain
how to make HP bar for static enemy.
Now draw a red rectangle and convertim like this to a movie clip
And now Make a Dynamic Text with instance name and var "enemy_hp",
like this:
HP bars can be made on difirent ways, some people use 100 frames
and shape tween, but i think that is way to complicated becouse
it can be made in just few lines of code, like this;
Oh yeah! You'll need to define enemys health on
mainframe of fighting engine, if your making fight engine in 2nd
frame
then add this code in Action Script of frame 2:
enemy_hp=100;
This all you need for healt bars, now let's make an enemy that
we can use for a punching bag. Just draw some
enemy and give him an instance name "enemy"; now try
to attack him and look how his HP drops on every hit
So final product should look something like this(click
on game if your controls doesn't work)