Permalink
Browse files

fix attack animation bug when pausing

  • Loading branch information...
1 parent 7269092 commit 9ad63ce2aa974a0b6e73ff5cf0250f446c68eece @KaeruCT committed Apr 21, 2012
Showing with 8 additions and 4 deletions.
  1. +3 −2 src/cvrn/IntroState.as
  2. +4 −0 src/cvrn/PlayState.as
  3. +1 −2 src/cvrn/Player.as
View
@@ -18,7 +18,7 @@ package cvrn
override public function create():void
{
FlxG.bgColor = 0xff000000;
- FlxG.playMusic(SoundAssets.getInstance().getAsset("intro",false), 0.6, 100);
+ FlxG.playMusic(SoundAssets.getInstance().getAsset("intro", false), 0.9, 100);
// declaring the sprite variable that will hold the splash image
var splash:FlxSprite = new FlxSprite(0, 0, ImageAssets.getInstance().getAsset("splash", false));
@@ -43,6 +43,7 @@ package cvrn
attractMode = false;
FlxG.mouse.show(ImageAssets.getInstance().getAsset("cursor", false), 2);
+ FlxG.flash(0xaa000000, 1);
}
override public function destroy():void
@@ -114,7 +115,7 @@ package cvrn
{
fading = true;
FlxG.play(SoundAssets.getInstance().getAsset("hit", true));
- FlxG.flash(0xffffffff, 0.8);
+ FlxG.flash(0xff000000, 0.8);
FlxG.fade(0xff000000, 1, function():void {
FlxG.switchState(new PlayState());
View
@@ -116,6 +116,10 @@ package cvrn
// pause toggling
if(this.world.getPlayer().alive) {
if (FlxG.keys.justPressed(settings.PAUSE_KEY[0]) || FlxG.keys.justPressed(settings.PAUSE_KEY[1])) {
+ if(!FlxG.paused){
+ // this avoids an animation bug
+ world.getPlayer().setAttacking(false);
+ }
togglePause();
}
View
@@ -125,8 +125,6 @@ package cvrn
}
}
- notifyEquipment("update");
-
this.velocity.x = xvel;
this.velocity.y = yvel;
@@ -141,6 +139,7 @@ package cvrn
this.getCurrentState().update(this);
super.update();
+ notifyEquipment("update");
}
public function changeAnimation(obj:GameObject = null):void

0 comments on commit 9ad63ce

Please sign in to comment.