Skip to content
Permalink
Browse files
Snap the obstacle back to its original position when its past the player
  • Loading branch information
MattyRad committed Feb 8, 2020
1 parent 8167ca6 commit bc391e13a0ed8229b7961e9c619ea41322f3005d
Showing 1 changed file with 4 additions and 0 deletions.
@@ -28,6 +28,10 @@ var animate = function () {

obstacle.position.x -= 0.01;

if (obstacle.position.x < (initial_x - 1)) {
obstacle.position.x = 1;
}

renderer.render(scene, camera);
};

0 comments on commit bc391e1

Please sign in to comment.