gskinner/EaselJS — Issue #86: Animation not looping on keydown
Author: fullspeed
Created: 2011-11-08 06:48:34+00:00
State: open

var playerSprite = new SpriteSheet(player, 32, 48, {idle_down: [0], idle_left: [4], idle_right: [8], idle_up: [12], walk_down: [0,3, true], walk_left: [4,7,true], walk_right: [8,11, true], walk_up: [12,15, true]});
playerSprite.loop = true;

Using simple mode, I added true to the end of the animation to make it loop, well this is not making the animation loop while the key is being pressed down.

Here is my input handler:

function HandleInput()
{
switch (moveOrder[0]) {
case 38: /* Up arrow was pressed */
if(playerSequence[playerID].paused)
{
playerSequence[playerID].gotoAndPlay("walk_up");
}
direction = "idle_up";
playerSequence[playerID].y -= playerSequence[playerID].vY;
break;
case 40: /* Down arrow was pressed */
playerSequence[playerID].gotoAndPlay("walk_down");
direction = "idle_down";
playerSequence[playerID].y += 10;
break;
case 37: /* Left arrow was pressed */
moving=true;
playerSequence[playerID].direction = -90;
playerSequence[playerID].gotoAndPlay("walk_left");
direction = "idle_left";
playerSequence[playerID].x -= playerSequence[playerID].vX;
break;
case 39: /* Right arrow was pressed */
playerSequence[playerID].gotoAndPlay("walk_right");
direction = "idle_right";
playerSequence[playerID].x += 10;
// playerSequence[playerID].y += playerSequence[playerID].vY
break;
default:
playerSequence[playerID].gotoAndPlay(direction);
break;
}
}

Have tried countless methods to get the animation to loop to no avail, what am I doing wrong?