Package net.shadewind.racetrack

Examples of net.shadewind.racetrack.Vector2i.y()


 
  private void checkCrash(Client client)
  {
    Car car = cars.get(client);
    Vector2i position = car.getPosition();
    if (map.getBlockType(position.x(), position.y()) == '#') {
      deactivateClient(client);
      car.setCrashed(true);
      for (Client c : clients)
        c.carCrashed(client.getId());
    }
View Full Code Here


    Vector2i pos = car.getPosition();
    if (pos == null)
      return;
   
    double originX = pos.x() + 0.5;
    double originY = pos.y() + 0.5;
    for (int y = -1; y <= 1; y++) {
      for (int x = -1; x <= 1; x++) {
        g.setColor(Color.WHITE);
        fillCircle(originX + x, originY + y, 0.5, g);
        g.setColor(Color.BLACK);
View Full Code Here

        Vector2i start = path.get(i);
        if (i < (path.size() - 1)) {
          Vector2i end = path.get(i + 1);
          Line2D line = new Line2D.Double(
              start.x() + 0.5, start.y() + 0.5,
              end.x() + 0.5, end.y() + 0.5);
          g.draw(line);
          fillCircle(start.x() + 0.5, start.y() + 0.5, 0.2, g);
        } else {
          fillCircle(start.x() + 0.5, start.y() + 0.5, 0.5, g);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.