Every game is a subclass of Game class.
public class YourGame extends com.golden.gamedev.Game { }
Game has 3 abstract methods to implement:
public void initResources() { } public void update() { } public void render(Graphics2D g) { }
New game skeleton code (Tutorial1.java):
import java.awt.Graphics2D; import com.golden.gamedev.Game; // import GTGE Library public class Tutorial1 extends Game { public void initResources() { // place for game initialization } public void update() { // update game variables } public void render(Graphics2D g) { // display to the screen } }See above template in action !
The skeleton show empty game running in applet environment
Next we'll see other game environment available....
1 2 3 4 5 6 7 | |
<< Previous Page | Next Page >> |