Level up:

In order to know when to level up I need to test the avatar mass to determine whether its high enough to advance to the next level.

If it is I need to then update the camera position and avatar position.

I can do this with a simple if statement:

if (newMass >= 3.5 && newMass <= 7 ){ }

Within this if statement I can place the necessary code to change the camera position. I will place this if statement within the on collision function so that that it is not called each frame within my animate function and doesn’t slow down my project.

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