| 1 | /** |
| 2 | * Main script |
| 3 | */ |
| 4 | |
| 5 | window.onload = init; |
| 6 | |
| 7 | function DoInheritance() |
| 8 | { |
| 9 | //resultclass = GameObject.inherit(baseclass, childclass); |
| 10 | } |
| 11 | |
| 12 | function init() |
| 13 | { |
| 14 | DoInheritance(); |
| 15 | //Game.initialize(xpos, ypos, width, height, fps, callback) |
| 16 | // -2 to account for borders |
| 17 | var width = window.innerWidth - 2; |
| 18 | var height = window.innerHeight - 2; |
| 19 | |
| 20 | Game.initialize(0, 0, width, height, gameStart); |
| 21 | } |
| 22 | |
| 23 | function gameStart() |
| 24 | { |
| 25 | GameWindow.backgroundColor = {r:100, g:149, b:237}; |
| 26 | |
| 27 | Game.setUpdateFunction(update); // Let the game engine know we want to link our 'update()' to the game's update step. |
| 28 | |
| 29 | GameAudio.init(sounds, soundsFolder); |
| 30 | |
| 31 | p1 = GameObject.create(gemSpawner, GameWindow.width / 2, GameWindow.height / 2, null, 500); |
| 32 | } |
| 33 | |
| 34 | function update(deltaTime) |
| 35 | { |
| 36 | |
| 37 | } |