Skip to content

Instantly share code, notes, and snippets.

@GraemeFulton
Created July 25, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GraemeFulton/834decdede1f3eb8b353 to your computer and use it in GitHub Desktop.
Save GraemeFulton/834decdede1f3eb8b353 to your computer and use it in GitHub Desktop.
Update x positions, the same way z is
//x positions
else if((this.floor[i].position.x - this.tileWidth)>camera.position.x){
this.floor[i].position.x-=(this.tileWidth*2);
}
//if the camera has moved past the entire square in the opposite direction, move the square the opposite way
else if((this.floor[i].position.x + this.tileWidth)<camera.position.x){
this.floor[i].position.x+=(this.tileWidth*2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment