1
0
Fork 0

Aufgabe 2 - neue Vorgabe fuer IBall + basic implementation

This commit is contained in:
rxbn_ 2019-12-02 22:51:46 +01:00
parent 7ba9618f63
commit dcc68e837a
2 changed files with 22 additions and 1 deletions

View File

@ -92,4 +92,21 @@ public class Ball implements IBall {
}
}
/**
* test if Ball hits paddle
* @param paddle paddle which will be tested
* @return true when ball hits paddle
*/
public boolean hitsPaddle(Paddle paddle) {
return false;
}
/**
* Ball got hit by Paddle paddle
* @param paddle hitbox mechanism of paddle
*/
public void reflectOnPaddle(Paddle paddle) {
return;
}
}

View File

@ -7,4 +7,8 @@ public interface IBall {
public void reactOnBorder();
public Position getPosition();
public Vector2D getDirection();
}
// Exercise 2
public boolean hitsPaddle(Paddle paddle);
public void reflectOnPaddle(Paddle paddle);
}