Esempio n. 1
0
  public void initLocation(int home) {
    Matrix3D trans = npc.getLocalTranslation();
    int mix = Math.min(10, -10) + (int) (Math.abs(10 + 12) * Math.random());

    switch (home) {
      case 1:
        spawnValue = 153;
        moveDirection = 1;
        trans.translate(153 + mix, 0, 0);
        break;
      case 2:
        spawnValue = 203;
        moveDirection = 1;
        trans.translate(203 + mix, 0, 0);
        break;
      case 3:
        spawnValue = 322;
        moveDirection = 1;
        trans.translate(322 + mix, 0, 0);
        break;
      case 4:
        spawnValue = 265;
        moveDirection = 1;
        trans.translate(265 + mix, 0, 0);
        break;
    }

    location = trans;
    npc.setLocalTranslation(trans);
    npc.updateWorldBound();
  }
Esempio n. 2
0
 public void moveForward() {
   Matrix3D npcMove = npc.getLocalTranslation();
   npcMove.translate(0, 0, (1 * difficulty * moveDirection));
   npc.setLocalTranslation(npcMove);
 }
Esempio n. 3
0
 public void moveToSpawn() {
   Matrix3D npcMove = npc.getLocalTranslation();
   npcMove.translate(0, 0, -300);
   npc.setLocalTranslation(npcMove);
 }