1     /** target frames per second  
2         @type Number
3     */
4     var FPS = 30;
5 /** time between frames 6 @type Number 7 */ 8 var SECONDS_BETWEEN_FRAMES = 1 / FPS;
9 /** A global reference to the GameObjectManager instance 10 @type GameObjectManager 11 */ 12 var g_GameObjectManager = null;
13 /** A global reference to the ApplicationManager instance 14 @type ApplicationManager 15 */ 16 var g_ApplicationManager = null;
17 /** The players score 18 @type Number 19 */ 20 var g_score = 0;
21 /** A reference to the player 22 @type Player 23 */ 24 var g_player = null;
25 /** An image to be used by the application 26 @type Image 27 */ 28 var g_run_left = new Image();
29 g_run_left.src = "run_left.png";
30 /** An image to be used by the application 31 @type Image 32 */ 33 var g_run_right = new Image();
34 g_run_right.src = "run_right.png";
35 /** An image to be used by the application 36 @type Image 37 */ 38 var g_idle_left = new Image();
39 g_idle_left.src = "idle_left.png";
40 /** An image to be used by the application 41 @type Image 42 */ 43 var g_idle_right = new Image();
44 g_idle_right.src = "idle_right.png";
45 /** An image to be used by the application 46 @type Image 47 */ 48 var g_back0 = new Image();
49 g_back0.src = "jsplatformer4_b0.png";
50 /** An image to be used by the application 51 @type Image 52 */ 53 var g_back1 = new Image();
54 g_back1.src = "jsplatformer4_b1.png";
55 /** An image to be used by the application 56 @type Image 57 */ 58 var g_back2 = new Image();
59 g_back2.src = "jsplatformer4_b2.png";
60 /** An image to be used by the application 61 @type Image 62 */ 63 var g_block = new Image();
64 g_block.src = "BlockA0.png";
65 /** An image to be used by the application 66 @type Image 67 */ 68 var g_gem = new Image();
69 g_gem.src = "Gem.png";
70 71 // The entry point of the application is set to the init function 72 window.onload = init;
73 74 /** 75 Application entry point 76 */ 77 function init()
78 {
79 new GameObjectManager().startupGameObjectManager();
80 }
Top