main.js 555 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This script is the main entry point of the game
  2. require("AtomicGame");
  3. Atomic.script("LevelParser");
  4. Atomic.game.init(start, update);
  5. // called at the start of play
  6. function start() {
  7. var game = Atomic.game;
  8. game.input.setMouseVisible(true);
  9. // create a 2D scene
  10. game.createScene2D();
  11. var uiNode = game.scene.createChild("UI");
  12. if (Atomic.platform == "iOS" || Atomic.platform == "Android")
  13. uiNode.createJSComponent("TouchInput");
  14. uiNode.createJSComponent("UI");
  15. }
  16. // called per frame
  17. function update(timeStep) {
  18. }