Level up solutions:

The working solution I’ve found for my first problem is relatively simple. In the if statement which tests whether the avatar is within a new level bracket I can add  “camStage !== 1” as a third query and then inside the statement change the camStage var to equal 1. This solves the problem of repeatedly being called.

The solution to the camera jumping however is not so simple, within three.js there is no way to animate the position of an object. I have done some searching around the internet and it appears that there is a library for javascript called Tween.js which can animate property of objects, both CSS and that of 3D libraries like three.js.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s