Example #1
0
  @Override
  public void handleKeys(EntityPlayer p, int data) {
    if (!sittingPositions.containsKey(p)) return;
    final int indx = sittingPositions.get(p);
    seats[indx].keys = data;

    if (T1A.isKeyPressed(data, T1A.BAIL)) getOut(p, T1A.isKeyPressed(data, T1A.SHIFT));

    if (T1A.isKeyPressed(data, T1A.BAIL)) getOut(p, T1A.isKeyPressed(data, T1A.SHIFT));
    if (indx == 0) { // driver - forward to ctrl bhv
      ctrlbhv.setKeys(data);
    }
  }
Example #2
0
 public void move() {
   ctrlbhv.tick();
   kin.tick();
   //		doCollision();
   prevPosX = posX;
   prevPosY = posY;
   prevPosZ = posZ;
   final Vector3f v = kin.getVelocity();
   posX += v.x;
   posY += v.y;
   posZ += v.z;
   setPos(posX, posY, posZ);
   //		rotationYaw= kin.getYaw();
   //		rotationPitch= kin.getPitch();
 }
Example #3
0
  @Override
  public void onUpdate() {
    if (onGround) updateOnGround();
    if (dying) updateDying();

    //		if(abs(vx)<.005)
    //			vy=0;
    //		if(abs(vy)<.005)
    //			vy=0;
    //		if(abs(vz)<.005)
    //			vz=0;

    if (posY < -64) setDead();

    if (seats[0].occupant != null)
      ctrlbhv.setLook(seats[0].occupant.rotationYaw, seats[0].occupant.rotationPitch);
    // keypresses are hooked

    move();

    for (Seat seat : seats) seat.update();
  }