Package pong.common

Examples of pong.common.Position


    this.listener = new KeyboardListener();
    this.window.setFocusable(true);
    this.roundWon = new Integer[2];
    this.position = new Position[3];
    for (int i = 0; i < 3; i++) {
      this.position[i] = new Position();
    }
    this.state = State.GETTING_SERVER_INFORMATION;
  }
View Full Code Here


  /**
   * Initializes the ball to (0, 0) position.
   */
  public Ball() {
    super();
    this.position = new Position();
  }
View Full Code Here

        }
        // randomly change the angular coefficient
        ball.setAngularCoefficient((float) (Math.random() * ServerSettings.MAX_ANGULAR_COEFFICIENT * 2 - ServerSettings.MAX_ANGULAR_COEFFICIENT));
      }
    }
    ball.setPosition(new Position(ballX, ballY));
  }
View Full Code Here

      x -= deltaX;
    }
    float y = positions[2].getY();
    final double deltaY = deltaX * ball.getAngularCoefficient();
    y += deltaY;
    ball.setPosition(new Position(x, y));
    if (ball.getPosition().getX() < 0 - GlobalSettings.BALL_DIAMETER) {
      return 2;
    }
    if (ball.getPosition().getX() > GlobalSettings.FIELD_WIDTH) {
      return 1;
View Full Code Here

   */
  public Player() {
    super();
    this.connected = false;
    this.movement = null;
    this.position = new Position();
  }
View Full Code Here

TOP

Related Classes of pong.common.Position

Copyright © 2018 www.massapicom. 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.