topical media & game development
mobile-query-three-plugins-ogsworkshop-examples-game015.htm / htm
<!--
* now we add a keyboard control to our character.
* This is another part of the tQuery minecraft plugins
-->
<!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);
// add a keyboard control
tQuery.createMinecraftCharKeyboard2({
object3D : character.object3D('root'),
lateralMove : 'rotationY'
});
})
</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.