topical media & game development

talk show tell print

mobile-query-three-plugins-ogsworkshop-examples-game020.htm / htm



  <!--
          Make character run all the time
  -->
  
  <!doctype html><title>Minimal tQuery Page</title>
  <script src="../../../build/tquery-bundle-require.js"></script>
  <body><script>
  require(['tquery.minecraft', 'tquery.skymap', 'tquery.grassground', 'tquery.keyboard'], function(){
          // create world
          var world        = tQuery.createWorld().boilerplate().start();
          // add a skybox
          tQuery.createSkymap('skybox').addTo(world);
  
          // add a ground        
          var ground  = tQuery.createGrassGround({
                  textureRepeatX  : 20,
                  textureRepeatY  : 20,
          }).addTo(world)
          .scale(80);
          ground.get(0).material.map.anisotropy = 16;
  
          // add minecraft char
          var character        = tQuery.createMinecraftChar().addTo(world);        
          // ad a keyboard control
          tQuery.createMinecraftCharKeyboard2({
                  object3D        : character.object3D('root'),
                  lateralMove        : 'strafe'
          });        
  
          // make it run all the time
          var bodyAnims        = new tQuery.MinecraftCharAnimations(character);
          bodyAnims.start('run');
  })
  </script></body>
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.