我这里有一大块代码,一旦到达对象并按下向下键,我就可以在第1帧和第2帧之间切换,这是不同的级别。但它根本不起作用......我一直收到错误1010,一个术语未定义且没有属性(然后是位置)但是我找不到问题所在的任何问题。
} else if(e.keyCode == Keyboard.DOWN){
downPressed = true;
if(player.hitTestObject(back.Other.lockedDoor)){
//proceed to the next level if the player is touching an open door
gotoLevel2();
}
}
}
function gotoLevel2():void{
back.Other.gotoAndStop(2); //updates door and key
back.Visuals.gotoAndStop(2); //updates the visuals
back.Visuals_2.gotoAndStop(2);
back.Collisions.gotoAndStop(2); //updates the collisions
scrollX = 0; //resets the player's x position in the new level
scrollY = 500; //resets the player's y position in the new level
}
ANy修复/建议?这个项目的截止日期正在慢慢逼近,我开始担心了!
提前干杯
如果有人感觉超级亲切,我可以发送文件。 Teehee!
答案 0 :(得分:0)
查看if(player.hitTestObject(back.Other.lockedDoor)){
Other
未定义,因此请将其替换为if(player.hitTestObject(back.lockedDoor)){
(对于阅读此内容的其他用户,他发送了fla
)
也正因为如此,请从back.Other.gotoAndStop(2);
功能中删除gotoLevel2
。此外,未定义Visuals
,Visuals2
和Collisions
。修复或删除该部分代码。
PS
我通过电子邮件向您发送了固定的fla