main.js 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This script is the main entry point of the game
  2. // called at the start of play
  3. function Start() {
  4. var game = Atomic.game;
  5. // create a 2D scene
  6. game.createScene3D();
  7. var scene = game.scene;
  8. // zone
  9. var zoneNode = scene.createChild("Zone")
  10. var zone = zoneNode.createComponent("Zone");
  11. zone.boundingBox = [-1000, -1000, -1000, 1000, 1000 , 1000];
  12. zone.ambientColor = [0.35, 0.35, 0.35];
  13. zone.fogColor = [0.1, 0.1, 0.1, 1.0];
  14. zone.fogStart = 10;
  15. zone.fogEnd = 100;
  16. game.cameraNode.position = [0, 2.5, -6];
  17. game.cameraNode.pitch(20);
  18. var lightNode = scene.createChild("Directional Light");
  19. lightNode.direction = [0.6, -1.0, 0.8];
  20. var light = lightNode.createComponent("Light")
  21. light.lightType = Atomic.LIGHT_DIRECTIONAL;
  22. // create the game component
  23. var node = game.scene.createChild("Chest");
  24. node.createJSComponent("Chest");
  25. }
  26. // called per frame
  27. function Update(timeStep) {
  28. }