main.js 550 B

12345678910111213141516171819202122232425262728293031
  1. // This script is the main entry point of the game
  2. require("AtomicGame");
  3. Atomic.script("Utils.js");
  4. Atomic.game.init(start, update);
  5. // called at the start of play
  6. function start() {
  7. var game = Atomic.game;
  8. // create a 2D scene
  9. game.createScene3D();
  10. // create the game component
  11. var node = game.scene.createChild("TheScene");
  12. node.createJSComponent("Scene");
  13. if (Atomic.platform == "iOS" || Atomic.platform == "Android")
  14. node.createJSComponent("TouchInput");
  15. }
  16. // called per frame
  17. function update(timeStep) {
  18. }