varavatar =newTHREE.Mesh(body, cover);
marker.add(avatar);
varhand =newTHREE.SphereGeometry(50);
varright_hand =newTHREE.Mesh(hand, cover);
right_hand.position.set(-150, 0, 0);
avatar.add(right_hand);
varleft_hand =newTHREE.Mesh(hand, cover);
left_hand.position.set(150, 0, 0);
avatar.add(left_hand);
varfoot =newTHREE.SphereGeometry(50);
varright_foot =newTHREE.Mesh(foot, cover);
right_foot.position.set(-75, -125, 0);
avatar.add(right_foot);
varleft_foot =newTHREE.Mesh(foot, cover);
left_foot.position.set(75, -125, 0);
avatar.add(left_foot);
marker.add(camera);
vartree_with_treasure;
vartrees = [];
trees.push(makeTreeAt( 500, 0));
trees.push(makeTreeAt(-500, 0));
trees.push(makeTreeAt( 750, -1000));
trees.push(makeTreeAt(-750, -1000));
functionmakeTreeAt(x, z) {
// Don't change any code at the start...
vartrunk =newTHREE.Mesh(
newTHREE.CylinderGeometry(50, 50, 200),
newTHREE.MeshBasicMaterial({color: 0xA0522D})
);
vartop =newTHREE.Mesh(
newTHREE.SphereGeometry(150),
newTHREE.MeshBasicMaterial({color: 0x228B22})
);
top.position.y = 175;
trunk.add(top);
varboundary =newTHREE.Mesh(
newTHREE.CircleGeometry(300),
newTHREE.MeshNormalMaterial()
);
report erratum • discuss
Code: Fruit Hunt • 235
Prepared exclusively for Michael Powell