topical media & game development

talk show tell print

mobile-query-three-plugins-minecraft-examples-controls.htm / htm



  <!doctype html><title>Minimal tQuery Page</title>
  <script src="../../../build/tquery-bundle-require.js"></script>
  <body><script>
  require(['tquery.minecraft', 'tquery.keyboard'], function(){
          var world        = tQuery.createWorld().boilerplate().start();
          var object	= tQuery.createTorusKnot().addTo(world);
          
          // your code goes here
          var character        = tQuery.createMinecraftChar().addTo(world);
          var controls        = tQuery.createMinecraftCharControls(character);
          
          world.loop().hook(function(){
                  var keyboard        = tQuery.keyboard();
                  var input        = controls.input();
                  input.right        = keyboard.pressed('right');
                  input.up        = keyboard.pressed('up');
                  input.left        = keyboard.pressed('left');
                  input.down        = keyboard.pressed('down');
          })
  });
  </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.