Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Rambler extends GameObject {
- @FXML
- Label labelStatus1;
- @FXML
- private Color color;
- private int x;
- private int y;
- private Jake jake;
- private int score;
- private BreadthOfTheGhost breadthOfTheGhost;
- public Rambler(Color color, int x, int y, Jake jake, BreadthOfTheGhost breadthOfTheGhost ){
- this.color = color;
- this.x = x;
- this.y = y;
- this.jake = jake;
- this.breadthOfTheGhost = breadthOfTheGhost;
- }
- @Override
- public void update(KeyCode keypressed) {
- breadthOfTheGhost.search(getX(),getY());
- }
- public void setY(int y) {
- this.y = y;
- }
- public void setX(int x) {
- this.x = x;
- }
- public Color getColor() {
- return color;
- }
- public int getX() {
- return x;
- }
- public int getY() {
- return y;
- }
- @Override
- public void draw(GraphicsContext g, SceneInfo sceneInfo) {
- g.setFill(this.getColor());
- g.fillRoundRect(this.getX() * sceneInfo.getFieldWidth(), this.getY() * sceneInfo.getFieldHeight(), sceneInfo.getFieldWidth(), sceneInfo.getFieldHeight(), 5,5);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement