Golden T Game Engine supports three game environment:
All the environments are setup in one step:
Game.setup (Dimension d, boolean fullscreen);dimension: size of the game.
Example of setting up game environment (Tutorial2.java):
import java.awt.*; import com.golden.gamedev.*; public class Tutorial2 extends Game { public void initResources() { } public void update() { } public void render(Graphics2D g) { } public static void main(String[] args) { // random windowed/fullscreen mode boolean fullscreen = (new java.util.Random()).nextBoolean(); Game game = new Tutorial2(); // create the game game.setup (new Dimension(640, 480), fullscreen); game.start(); // start the game } }
To run this example java -classpath %CLASSPATH%;golden_0_1_2.jar Tutorial2
(see page 2)
The game will running in random environment, Fullscreen or Windowed mode.
For Applet mode, embed Tutorial2.class into your HTML page (like below), and that what Applet is.
<html> <applet code="Tutorial2.class" archive="golden_0_1.jar" width="640" height="480"> </applet> </html>
Allright, you should've understand the basic settings
Now let's see how to create a game along with Game class.....
1 2 3 4 5 6 7 | |
<< Previous Page | Next Page >> |