jhylands

Creating alians

Jul 10th, 2013
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alians[z][x] = new Object();
  2.             alians[z][x].aBody = new Object();
  3.             alians[z][x].aWing = new Object();
  4.             //generate the alians body
  5.             alians[z][x].aBody.object = new THREE.Mesh(aGeometry, aMaterial);
  6.             alians[z][x].aBody.object.position.set(2*x-10,0,2*z-30);//-3,0,0
  7.             scene.add(alians[z][x].aBody.object);
  8.             //generate the alians wing
  9.             alians[z][x].aWing.object = new THREE.Mesh(aWingGeometry, aWingMaterial);
  10.             alians[z][x].aWing.object.position.set(2*x-10,-1,2*z-30);//-3,-1,0
  11.             scene.add(alians[z][x].aWing.object);
  12.             //give the alian some velocity or at least inishiate the variables
  13.             alians[x][z].velocity = new Object();
  14.             alians[x][z].velocity.x=0.01;
  15.             alians[x][z].velocity.y=0;
  16.             alians[x][z].velocity.z=0;
  17.             //add a bool showing weather the object should be treated as being there or not
  18.             alians[x][z].shown = true;
Advertisement
Add Comment
Please, Sign In to add comment