Skip to content

Commit

Permalink
Working out Animations and Timings, for First Character
Browse files Browse the repository at this point in the history
  • Loading branch information
wargfn committed Aug 31, 2010
1 parent 973471a commit f82e6f7
Showing 1 changed file with 64 additions and 27 deletions.
91 changes: 64 additions & 27 deletions src/com/blogspot/wargfndev/foofighter/sprites/Itachi.as
Expand Up @@ -18,6 +18,7 @@ package com.blogspot.wargfndev.foofighter.sprites
private var _jump_power:int = 800;
private var _max_health:int = 100;
private var _hurt_counter:Number = 0;
private var _attack_indicator:Number = 0;

public function Itachi(X:Number, Y:Number):void
{
Expand Down Expand Up @@ -46,16 +47,16 @@ package com.blogspot.wargfndev.foofighter.sprites
//Animation time, and let me tell you something....
//starting animations, woot
addAnimation("portrait", [0, 1, 2, 3, 4], 25);
addAnimation("idle", [5, 6, 7], 10);
addAnimation("bored", [5, 6, 7, 8, 7, 6, 5], 20);
addAnimation("duck", [5, 9, 10], 10);
addAnimation("walk", [12, 13, 14, 15, 16, 17], 15);
addAnimation("run", [18, 19, 20, 21, 22, 23], 10);
addAnimation("jump", [5, 24, 25, 26, 27], 10);
addAnimation("punch", [28, 29, 30, 31], 10);
addAnimation("kick", [32, 33, 34, 35, 36], 10);
addAnimation("spca", [37, 38, 39, 40, 41, 42, 43], 10);
addAnimation("spcb", [44, 45, 46, 47, 48, 49, 50], 10);
addAnimation("idle", [5, 6, 7], 3);
addAnimation("bored", [5, 6, 7, 8, 7, 6, 5], 7);
addAnimation("duck", [5, 9, 10], 3);
addAnimation("walk", [12, 13, 14, 15, 16, 17], 6);
addAnimation("run", [18, 19, 20, 21, 22, 23], 6);
addAnimation("jump", [5, 24, 25, 26, 27], 6);
addAnimation("punch", [28, 29, 30, 31], 4);
addAnimation("kick", [32, 33, 34, 34, 35, 35, 35, 35, 36, 36], 10);
addAnimation("spca", [37, 38, 39, 40, 41, 42, 43], 7);
addAnimation("spcb", [44, 45, 46, 47, 48, 49, 50], 7);
addAnimation("hit", [51, 51, 51, 52], 10);
addAnimation("dead", [51, 51, 52, 52, 53, 53, 54, 55], 10);

Expand Down Expand Up @@ -97,57 +98,93 @@ package com.blogspot.wargfndev.foofighter.sprites
}

//Test more Animations PLEASE
if (FlxG.keys.justPressed("DOWN")
if (FlxG.keys.justPressed("DOWN"))
{
play("duck");
_attack_indicator = 5;
}

if (FlxG.keys.justPressed("Z")
else if (FlxG.keys.justPressed("Z"))
{
play("punch");
_attack_indicator = 1;
}

if (FlxG.keys.justPressed("X")
else if (FlxG.keys.justPressed("X"))
{
play("kick");
_attack_indicator = 2;
}

if (FlxG.keys.justPressed("C")
else if (FlxG.keys.justPressed("C"))
{
play("spca");
_attack_indicator = 3;
}

if (FlxG.keys.justPressed("V")
else if (FlxG.keys.justPressed("V"))
{
play("spcb");
_attack_indicator = 4;
}
else
{
_attack_indicator = 0;
}

//Play Some ANIMATIONS PLEASE
if (_hurt_counter > 0)
{
play("hit");
}
else

else if (_attack_indicator > 0)
{
if (velocity.y != 0)
if (_attack_indicator == 1)
{
play("punch");
}
else if (_attack_indicator == 2)
{
play("kick");
}
else if (_attack_indicator == 3)
{
play("jump");
play("spca");
}
else if (_attack_indicator == 4)
{
play("spcb");
}
else
{
if (velocity.x > 75)
{
play("run");
}
else if (velocity.x > 0)
play("duck");
}
}

else
{
if (_attack_indicator < 1)
{
if (velocity.y != 0)
{
play("walking");
play("jump");
}
else
{
play("idle");
if (velocity.x > 75)
{
play("run");
}
else if (velocity.x > 0)
{
play("walking");
}
else
{
//play("idle");
}
}
}
}
}


Expand Down

0 comments on commit f82e6f7

Please sign in to comment.