我正在制作一个游戏,你可以躲避天空中的物体,并为其制作动画,我只是在像 234567 234567 这样的帧之间循环,但是当我添加更多帧时,它会像 123456789,10,12,13,14,15 234567 234567有人可以帮忙吗?
function oKeyDown(e:KeyboardEvent):void {
trace("key being pressed");
switch(e.keyCode) {
case Keyboard.LEFT:
v = -speed;
player.scaleX = 1;
running();
break;
case Keyboard.RIGHT:
v = speed;
player.scaleX = -1;
running();
break;
}
}
function running():void {
trace(String(player.currentFrame));
if(player.currentFrame < 2 || player.currentFrame > 7) {
player.gotoAndPlay(2);
}
}
function oKeyUp(e:KeyboardEvent):void {
trace("key being let go");
v = 0;
player.gotoAndStop(1);
trace(String(player.currentFrame));
https://www.mediafire.com/file/qibipztp58v9hj1/Dodge_Falling_Objects.fla/file
我认为你的大于和小于的顺序是错误的