Scene.js 511 B

12345678910111213141516171819202122232425
  1. var game = Atomic.game;
  2. var node = self.node;
  3. function start() {
  4. var scene = game.scene;
  5. var lightNode = scene.createChild("Directional Light");
  6. lightNode.direction = [0.6, -1.0, 0.8];
  7. var light = lightNode.createComponent("Light")
  8. light.lightType = Atomic.LIGHT_DIRECTIONAL;
  9. // add the roboman
  10. var roboman = node.createChild("TheRoboMan");
  11. roboman.createJSComponent("RoboMan");
  12. }
  13. // we need an update or it doesn't run the start, fix in JSVM
  14. function update(timeStep) {
  15. }