Animate sequence is not working well...

privateint[] sequenceWalkRight ={ 2, 3, 0, 2, 3, 0, 2, 3, 0};

privateint[] sequenceWalkLeft ={ 4, 5, 0, 4, 5, 0, 4, 5, 0, 4, 5, 0};

publicvoid moveSprite(char direction){

switch (direction){

case'u':{

this.move(0, -(MOVE_SIZE));

break;

}

case'd':{

this.move(0, MOVE_SIZE);

break;

}

case'r':{

this.setFrameSequence(this.sequenceWalkRight);

this.move(MOVE_SIZE, 0);

break;

}

case'l':{

this.setFrameSequence(this.sequenceWalkLeft);

this.move(-(MOVE_SIZE), 0);

break;

}

}

this.nextFrame();

}

This method is called when the user presses the cell keys. Then this method receives a char that represents direction the sprite should move. If user presses right key, the setFrameSequence is set for right. If the user presses left key, the setFrameSequence is set for left.

But the problem is that the animation goes through right or left sequences only when the user presses UP or DOWN.

What's going on here?

Thanks for your reply.

[2187 byte] By [coffee95a] at [2007-11-27 4:53:30]
# 1
> What's going on here?i don't know!! can you show us the keyPressed method?
suparenoa at 2007-7-12 10:07:56 > top of Java-index,Java Mobility Forums,Java ME Technologies...