代码拉取完成,页面将自动刷新
<!DOCTYPE HTML>
<html>
<head>
<title>WebCraft</title>
<!-- Character encoding -->
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<!-- Stylesheet -->
<link href="style/main.css" rel="stylesheet" type="text/css">
<!-- Modules -->
<script src="js/glMatrix-1.2.min.js" type="text/javascript"></script>
<script src="js/blocks.js" type="text/javascript"></script>
<script src="js/helpers.js" type="text/javascript"></script>
<script src="js/world.js" type="text/javascript"></script>
<script src="js/render.js" type="text/javascript"></script>
<script src="js/physics.js" type="text/javascript"></script>
<script src="js/player.js" type="text/javascript"></script>
</head>
<body oncontextmenu="return false">
<!-- Render surface -->
<canvas id="renderSurface"></canvas>
<!-- Material selection -->
<table id="materialSelector">
<tr></tr>
</table>
<!-- Initialisation code -->
<script type="text/javascript">
// Create a new flat world
var world = new World( 16, 16, 16 );
world.createFlatWorld( 6 );
// Set up renderer
var render = new Renderer( "renderSurface" );
render.setWorld( world, 8 );
render.setPerspective( 60, 0.01, 200 );
// Create physics simulator
var physics = new Physics();
physics.setWorld( world );
// Create new local player
var player = new Player();
player.setWorld( world );
player.setInputCanvas( "renderSurface" );
player.setMaterialSelector( "materialSelector" );
// Render loop
setInterval( function()
{
var time = new Date().getTime() / 1000.0;
// Simulate physics
physics.simulate();
// Update local player
player.update();
// Build a chunk
render.buildChunks( 1 );
// Draw world
render.setCamera( player.getEyePos().toArray(), player.angles );
render.draw();
while ( new Date().getTime() / 1000 - time < 0.016 );
}, 1 );
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。