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 /** An image to be used by the application 14 @type Image 15 */ 16 var g_run_left = new Image(); 17 g_run_left.src = "run_left.png"; 18 /** An image to be used by the application 19 @type Image 20 */ 21 var g_run_right = new Image(); 22 g_run_right.src = "run_right.png"; 23 /** An image to be used by the application 24 @type Image 25 */ 26 var g_idle_left = new Image(); 27 g_idle_left.src = "idle_left.png"; 28 /** An image to be used by the application 29 @type Image 30 */ 31 var g_idle_right = new Image(); 32 g_idle_right.src = "idle_right.png"; 33 /** An image to be used by the application 34 @type Image 35 */ 36 var g_back0 = new Image(); 37 g_back0.src = "jsplatformer4_b0.png"; 38 /** An image to be used by the application 39 @type Image 40 */ 41 var g_back1 = new Image(); 42 g_back1.src = "jsplatformer4_b1.png"; 43 /** An image to be used by the application 44 @type Image 45 */ 46 var g_back2 = new Image(); 47 g_back2.src = "jsplatformer4_b2.png"; 48 /** An image to be used by the application 49 @type Image 50 */ 51 var g_block = new Image(); 52 g_block.src = "BlockA0.png"; 53 54 // The entry point of the application is set to the init function 55 window.onload = init; 56 57 /** 58 Application entry point 59 */ 60 function init() 61 { 62 new GameObjectManager().startupGameObjectManager(); 63 }