usegamekeys.java

来自「Java 3D Game SDK.老外做的.」· Java 代码 · 共 59 行

JAVA
59
字号
/* * UseGameKeys.java */package org.java3dgamesdk.samples.II;import org.java3dgamesdk.core.*;import org.java3dgamesdk.core.util.*;/** * This sample application demonstrates how to use the game keys. * This class has also the GameFrame as super class. * * @author  Norbert Nopper */public class UseGameKeys extends GameFrame {        public static void main(String[] argv) {        // create the object                UseGameKeys useGameKeys = new UseGameKeys();                // create the object and pass the game frame to it ...        RenderSelection renderSelection = new RenderSelection(useGameKeys);        // ... rest is done by the dialog        renderSelection.show();            }    /**     * Not used here.     */    protected void initGame() {    }        /**     * This application uses the game keys to exit the engine by pressing throws ESC key.     *     *@param currentTime the current game time in miliseconds, starting with 0     */    protected void updateGame(long currentTime) {        if(gameKeys[27])            exit();    }        /**     * Whenever a scene has to be rendered, the surface has to be cleaned first.     */    protected void renderGame() {        gc3D.clear();            }        /**     * Not used here.     */    protected void exitGame() {    }        }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?