main.js 773 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // This script is the main entry point of the game
  2. require("AtomicGame");
  3. Atomic.script("LevelParser");
  4. var uiConfig = {
  5. //tbui->Initialize("UI/language/lng_en.tb.txt");
  6. //tbui->LoadSkin("UI/default_skin/skin.tb.txt", "Skin/skin.tb.txt");
  7. //tbui->AddFont("UI/fonts/vera.ttf", "Vera");
  8. //tbui->SetDefaultFont("Vera", 12);
  9. }
  10. Atomic.game.init(start, update);
  11. // called at the start of play
  12. function start() {
  13. var game = Atomic.game;
  14. game.input.setMouseVisible(true);
  15. // create a 2D scene
  16. game.createScene2D();
  17. var uiNode = game.scene.createChild("UI");
  18. if (Atomic.platform == "iOS" || Atomic.platform == "Android")
  19. uiNode.createJSComponent("TouchInput");
  20. uiNode.createJSComponent("UI");
  21. }
  22. // called per frame
  23. function update(timeStep) {
  24. }