fpshooter3d.java

来自「java3D game engine design of the source 」· Java 代码 · 共 48 行

JAVA
48
字号
// FPShooter3D.java// Andrew Davison, May 2003, dandrew@ratree.psu.ac.th/* The usual checkboard world used to illustrate coding for a   First Person Shooter (FPS).   The gun hand is a texture added to the user's viewpoint, controlled    by the KeyBehaviour class. When the gun is fired, a beam appears.   It explodes if it 'hits' the target, otherwise it just disappears.   PropManager is used to load a robot 'target'.   Several beams/explosions can be happening at the same time     - done by threads, but the Shapes are created at initialisation       time and reused.*/import javax.swing.*;import java.awt.*;public class FPShooter3D extends JFrame{  public FPShooter3D()   {    super("FPShooter3D");    Container c = getContentPane();    c.setLayout( new BorderLayout() );    WrapFPShooter3D w3d = new WrapFPShooter3D();    c.add(w3d, BorderLayout.CENTER);    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );    pack();    setResizable(false);    // fixed size display    show();  } // end of FPShooter3D()// -----------------------------------------  public static void main(String[] args)  { new FPShooter3D(); }} // end of FPShooter3D class

⌨️ 快捷键说明

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