OK! You’re actually really, really close here.
One bit of advice is to start small. In this case, cut back on the trees from 1,000 to 10, then bump them up from there once everything else is working.
isMovingLeft is not defined. That’s because there is a little typo near line 120:
var clock = new THREE.Clock();
var isCartwheeling = false;
var isFlipping = false;
var isMovingRight = false;
var isMovingLesf = false;
var isMovingForward = false;
var isMovingBack = false;
isMovingLeft and that error should go away.
There is another small type with the
acrobatics() function on line 172. It creates a function names
function acrobatoics() instead of
Also, inside the
walk() function near line 150, the “get” in
clock.getElapsedTime() should start with a lowercase g – right now it is
clock.GetElapsedTime() (capital G), which would cause an error.
Once you fix those minor typos, the code should work. If not, or if you have any questions – don’t hesitate to ask!
P.S. There might be one more typo in there when the avatar moves left or right. Can you find it?