Untitled Game
by BoldPenguin1447 lines1.1 KB🛠️ Three.js (3D graphics)
<!DOCTYPE html>
<html>
<head>
<style>
body { margin:0; overflow:hidden; }
canvas { display:block; }
</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.min.js"></script>
<script>
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x87ceeb);
const camera = new THREE.PerspectiveCamera(75,innerWidth/innerHeight,0.1,1000);
camera.position.set(0,2,8);
const renderer = new THREE.WebGLRenderer({antialias:true});
renderer.setSize(innerWidth,innerHeight);
document.body.appendChild(renderer.domElement);
scene.add(new THREE.HemisphereLight(0xffffff,0x444444,2));
const ground = new THREE.Mesh(
new THREE.PlaneGeometry(200,200),
new THREE.MeshStandardMaterial({color:0x555555})
);
ground.rotation.x=-Math.PI/2;
scene.add(ground);
for(let i=0;i<20;i++){
let b=new THREE.Mesh(new THREE.BoxGeometry(5,Math.random()*15+5,5),
new THREE.MeshStandardMaterial({color:0x777777}));
b.position.set(Math.random()*80-40,5,Math.random()*-100);
scene.add(b);
}
function animate(){
requestAnimationFrame(animate);
renderer.render(scene,camera);
}
animate();
</script>
</body>
</html>
Game Source: Untitled Game
Creator: BoldPenguin14
Libraries: three
Complexity: simple (47 lines, 1.1 KB)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: untitled-game-boldpenguin14" to link back to the original. Then publish at arcadelab.ai/publish.