1

我正在创建一个 Flash 游戏。不幸的是,当玩家按下“Enter”时,游戏会不断循环其场景。我尝试了以下方法(尽管我知道这有点笨拙):

            // The Enter Key was pressed
            // If the Enter key is pressed, the keyboard input is "changed" to
                // be '.'.  This prevents a problem in which the Player would
                // press 'Enter' and the game screen would continuously cycle
                // through scenes
        if (event.keyCode == Keyboard.ENTER) {
            // The 'PERIOD' key does nothing
            event.keyCode = Keyboard.PERIOD;
            //spaceKeyPressed = true;
        }           

有没有办法防止“进入”在场景中循环?

谢谢,

基督教

4

1 回答 1

3

在 Flash Professional中使用Test Movie测试您的游戏时,请从“控制”菜单中选择“禁用键盘快捷键” ,否则,如您在“控制”菜单中所见,第一项是“播放”,其中包含Enter键作为键盘快捷键。

请注意,控制菜单中的项目会根据您当前是否正在测试电影而改变。在测试游戏时,您只会看到下面屏幕截图中的菜单。

在此处输入图像描述

于 2012-02-12T05:07:02.333 回答