Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. public class Rambler extends GameObject {
  2.  
  3.  
  4. @FXML
  5. Label labelStatus1;
  6. @FXML
  7.  
  8.  
  9.         private Color color;
  10.         private int x;
  11.         private int y;
  12.        private  Jake jake;
  13.         private int score;
  14.         private BreadthOfTheGhost breadthOfTheGhost;
  15.  
  16.         public Rambler(Color color, int x, int y, Jake jake, BreadthOfTheGhost breadthOfTheGhost ){
  17.             this.color = color;
  18.             this.x = x;
  19.             this.y = y;
  20.             this.jake = jake;
  21.             this.breadthOfTheGhost = breadthOfTheGhost;
  22.  
  23.  
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.         @Override
  31.         public void update(KeyCode keypressed) {
  32.  
  33.  
  34.             breadthOfTheGhost.search(getX(),getY());
  35.  
  36.             }
  37.  
  38.  
  39.  
  40.  
  41.     public void setY(int y) {
  42.         this.y = y;
  43.     }
  44.     public void setX(int x) {
  45.         this.x = x;
  46.     }
  47.     public Color getColor() {
  48.         return color;
  49.     }
  50.     public  int getX() {
  51.         return x;
  52.     }
  53.     public  int getY() {
  54.         return y;
  55.     }
  56.  
  57.  
  58.  
  59.     @Override
  60.         public void draw(GraphicsContext g, SceneInfo sceneInfo) {
  61.  
  62.             g.setFill(this.getColor());
  63.  
  64.             g.fillRoundRect(this.getX() * sceneInfo.getFieldWidth(), this.getY() * sceneInfo.getFieldHeight(), sceneInfo.getFieldWidth(), sceneInfo.getFieldHeight(), 5,5);
  65.  
  66.         }
  67.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement