Skip to content
Permalink
Browse files

Move the obstacle left

  • Loading branch information
MattyRad committed Feb 8, 2020
1 parent 3dd9fad commit 8167ca6e7e938563e154536476c952428a6ab810
Showing with 5 additions and 0 deletions.
  1. +5 −0 public/scripts.js
@@ -9,6 +9,9 @@ document.body.appendChild( renderer.domElement );
var geometry = new THREE.BoxGeometry( 0.2, 1, 0.2 );
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
var player = new THREE.Mesh( geometry, material );
var initial_x = player.position.x;
var initial_y = player.position.y;
var initial_z = player.position.z;
scene.add( player );

// obstacle
@@ -23,6 +26,8 @@ camera.position.z = 5;
var animate = function () {
requestAnimationFrame( animate );

obstacle.position.x -= 0.01;

renderer.render(scene, camera);
};

0 comments on commit 8167ca6

Please sign in to comment.
You can’t perform that action at this time.