43444546474849
public Paddle(PaddleConfig paddleConfig) { this.paddleConfig = paddleConfig; this.speed = new SpeedVector2D(0, 0); this.acceleration = new Acceleration2D(0, 0); this.verticles = new Vertices2D(paddleConfig.getStartVertices()); }
170171172173174175176
public void resetToStartSituation() { speed.zero(); acceleration.zero(); verticles = null; verticles = new Vertices2D(paddleConfig.getStartVertices()); }
269270271272273274275
/** * @return Zbiór wierzchołków. */ public Vertices2D getVerticles() { return new Vertices2D(verticles); }
547548549550551552553554555556557558
* wektor prędkości. */ @Override public void handle(Collision collision) { final Vertices2D paddleVertices = paddle.getVerticles(); double alpha = (ball.getCoordinates().getX() - paddleVertices.getMinX()) / (paddleVertices.getMaxX()-paddleVertices.getMinX()); if(alpha < 0) { alpha = 0; } else if(alpha > 1)