Do you know how to use variables? This is mostly variable use. This will be an easy way so it is easily understood. It is possible to improve these later. It actually would be better to, but first you need to understand the concept, then develop from that... Unless you know coding already.
.-jump only once, and run an animation before it jumps, while it is on air and when it falls
Create a variable called jump. Upon collision with the ground, set jump to 1. Add a key down event for your jump event. If the actor has jump, then jump. Also add a change animation. Upon the end of the jumpstart animation add another event that changes animation. I am not sure what you mean by end, if you just mean on the actor's decent or falling, if yvelocity>3 or some number, do not put it at zero, as it will mess with normal animations, change the animation (this is draw actor event)
.-walk on a floor, and make this floor solid
I tend to make movement in draw actor. You could also use individual keydown events.
Actor->DrawActor->Script Editor
- Code: Select all
char* key=GetKeyState(); // allows key use
if (key[KEY_RIGHT]==1)
{
x+=10;
// you will need a direction variable or use the angle/direction variable built in, this will allow the actor to choose which
// set of animations to use
// your change animation, this method can become a problem if you want anti-moonwalking help just ask
}
// and another one for left, changing the direction and other
Also, you need to land, so create an event upon collision with ground (enable repeat), and set it to physical response (the bottom two should be set to 0)
.-make a good life bar
There are many methods for this. You can make a text one or an animation. I would make an animation. Create an vertical image that looks like this,
_______
[]
[][]
[][][]
_______
Upon the creation of this actor (health bar), set the animation to stop
Health Bar->DrawActor->Script Editor
- Code: Select all
animpos=HP;
.-make actors take damage while an attack it executed on them, but certain amount depending on the attack
Upon the attack button down, you can set a variable to make an attack, you can also set the damage it will deal and other 'stats' about the attack
So on the enemy's collision with your main actor, it would have an attack, one way of attack, just use certain attacks for certain variables
- Code: Select all
switch (attack)
{
case 1:
EnemyHP-=10; // 10 is the damage, if you are using a damage variable determined by the attack then you can switch the 10 to damage.
// Using an array for health makes creating many actors easier, I can explain in depth if you want
// You would also want to add a knock back, if the attack is right or if a certain variable is triggered
// Also a ChangeAnimation
break;
case 2:
// Similar to the previous
}
.-make actors have an animation while they are taking damage
Answered above
.-make actors have an animation to send they flying if the damage if too huge or after excecuting certain attack
Answered above ( You can set a conditional there such as,
- Code: Select all
if (damage>10)
{
//knock back, ChangeAnimation
}
.-make a timer to stop the fight if the time passed
Set a count down? Have an actor that is a text actor
In its creation event, make a variable for the given time
In its draw actor
- Code: Select all
textNumber=countdown;
countdown--;
Any questions, just ask. These may be flawed depending on how you set everything up...
Also you will need a way of sorting animation priority, so your events can't overide other events. If you need help on this I think this topic covers it well enough...
http://game-editor.com/forum/viewtopic.php?f=5&t=6465It has it 'built in'. Also it will allow you to do combos, if you want that.