Old Style Game Framework How To..

Creating a Game with Old Style Game Framework.

This walk through create a side scroller game, where the player runs across the screen and jumps over obstacles. The walk through uses the Old Style Game Framework (1.0.2), Game Doc (1.2.3) and Game Designer (1.2.2).

Updated versions: Old Style Framework (1.1), Game Doc (1.3) and Game Designer (1.3)

SideScrollerCanvas.java
06 package org.deken.sidescroller;
07 
08 import java.awt.event.KeyEvent;
09 import org.deken.game.GameCanvas;
10 import org.deken.gameDoc.document.DocumentManager;
11 import org.deken.gameDoc.document.GameDocument;
12 import org.deken.sidescroller.states.Start;
13 
14 /**
15  <p>
16  * Title: SideScrollerCanvas</p>
17  *
18  <p>
19  * Description: </p>
20  *
21  * Copyright: Copyright (c) Jul 26, 2014
22  *
23  @author Gary Deken <gary@abberkeep.us>
24  @version 1.0
25  */
26 public class SideScrollerCanvas extends GameCanvas {
27    private GameDocument gameDocument;
28 
29    public SideScrollerCanvas(int width, int height) {
30       super(width, height);
31       // ManualGameCanvas
32       //super(width, height, KeyEvent.VK_P, KeyEvent.VK_O);
33       int i = KeyEvent.VK_0;
34       DocumentManager documentManger = new DocumentManager(true);
35       gameDocument = documentManger.loadGameDocument("Side Scroller.xml");
36 
37       Start start = new Start(gameDocument);
38 
39       setGameState(start);
40    }
41 
42 }
Back