teststandardgame.java.svn-base
来自「一个JAVA程序员的游戏」· SVN-BASE 代码 · 共 60 行
SVN-BASE
60 行
/*
* TestStandardGame.java
*
* Created on 20. Januar 2007, 17:03
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package kanjitori;
import com.jme.bounding.*;
import com.jme.math.*;
import com.jme.scene.shape.Box;
import com.jme.scene.shape.Cylinder;
import com.jmex.editors.swing.settings.*;
import com.jmex.game.*;
import com.jmex.game.state.*;
/**
* TestStandardGame is meant to be an example replacement of
* jmetest.base.TestSimpleGame using the StandardGame implementation
* instead of SimpleGame.
*
* @author Matthew D. Hicks
*/
public class TestStandardGame {
public static void main(String[] args) throws Exception {
StandardGame game = new StandardGame("A Simple Test");
GameSettingsPanel.prompt(game.getSettings());
game.start();
DebugGameState state = new DebugGameState();
Box box = new Box("my box", new Vector3f(0, 0, 0), 2, 2, 2);
box.setModelBound(new BoundingSphere());
box.updateModelBound();
box.updateRenderState();
state.getRootNode().attachChild(box);
GameStateManager.getInstance().attachChild(state);
state.setActive(true);
DebugGameState state1 = new DebugGameState();
Cylinder cyl = new Cylinder("my cyl", 5, 5, 5.0f, 1.0f);
cyl.setModelBound(new BoundingSphere());
cyl.updateModelBound();
cyl.updateRenderState();
state1.getRootNode().attachChild(cyl);
GameStateManager.getInstance().attachChild(state1);
state1.setActive(true);
while(true) {
Thread.sleep(1000);
state.setActive(false);
Thread.sleep(1000);
state.setActive(true);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?