@Test public void testSpawning() { initialise(); Mount mount = new Mount(); Player player = new Player(); mount.fly(true, false, false, false); assertTrue(mount.getVelX() < 0); mount.fly(false, true, false, false); assertTrue(mount.getVelX() > 0); mount.fly(false, false, false, true); assertTrue(mount.getVelY() > 0); mount.fly(false, false, true, false); assertTrue(mount.getVelY() < 0); }
public void fly(boolean left, boolean right, boolean up, boolean down) { if (left) { velX = -moveSpeed; } else if (right) { velX = moveSpeed; } else { velX = 0; } if (up) { velY = jumpSpeed; } else if (down) { velY = -2 * jumpSpeed; } else { velY = 0; } }
Mount extends BasicMovingEntity { public void fly(boolean left, boolean right, boolean up, boolean down) { if (left) { velX = -moveSpeed; } else if (right) { velX = moveSpeed; } else { velX = 0; } if (up) { velY = jumpSpeed; } else if (down) { velY = -2 * jumpSpeed; } else { velY = 0; } } }
Mount extends BasicMovingEntity { public void fly(boolean left, boolean right, boolean up, boolean down) { if (left) { velX = -moveSpeed; } else if (right) { velX = moveSpeed; } else { velX = 0; } if (up) { velY = jumpSpeed; } else if (down) { velY = -2 * jumpSpeed; } else { velY = 0; } } Mount(); }
Mount extends BasicMovingEntity { public void fly(boolean left, boolean right, boolean up, boolean down) { if (left) { velX = -moveSpeed; } else if (right) { velX = moveSpeed; } else { velX = 0; } if (up) { velY = jumpSpeed; } else if (down) { velY = -2 * jumpSpeed; } else { velY = 0; } } Mount(); void registerRider(Player rider); Player getRider(); void removeRider(Player player); void fly(boolean left, boolean right, boolean up, boolean down); float getSaddleX(); float getSaddleY(); }
Mount extends BasicMovingEntity { public void fly(boolean left, boolean right, boolean up, boolean down) { if (left) { velX = -moveSpeed; } else if (right) { velX = moveSpeed; } else { velX = 0; } if (up) { velY = jumpSpeed; } else if (down) { velY = -2 * jumpSpeed; } else { velY = 0; } } Mount(); void registerRider(Player rider); Player getRider(); void removeRider(Player player); void fly(boolean left, boolean right, boolean up, boolean down); float getSaddleX(); float getSaddleY();  }