RoboMan.js 669 B

12345678910111213141516171819202122232425262728293031
  1. var game = Atomic.game;
  2. var node = self.node;
  3. RoboMan = self;
  4. function start() {
  5. var cache = game.cache;
  6. var model = node.createComponent("AnimatedModel");
  7. model.setModel(cache.getResource("Model", "Models/RoboMan.mdl"));
  8. model.setMaterial(cache.getResource("Material", "Materials/Robot_01_Diffuse.xml"));
  9. var animCtrl = node.createComponent("AnimationController");
  10. animCtrl.playExclusive("Models/RoboMan_Normal_Run.ani", 0, true, 0.0);
  11. game.cameraNode.position = [0, 2, -10];
  12. node.yaw(180);
  13. }
  14. // we need an update or it doesn't run the start, fix in JSVM
  15. function update(timeStep) {
  16. node.yaw(timeStep * 100);
  17. }