Advertisement
Guest User

TileView

a guest
Jun 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. package sample;
  2.  
  3. import javafx.scene.image.Image;
  4. import javafx.scene.image.ImageView;
  5. import javafx.scene.image.WritableImage;
  6.  
  7. public class TileView extends ImageView {
  8.  
  9. public TileView(WritableImage image){
  10. super(image);
  11. }
  12.  
  13. boolean rightPlace;
  14. //boolean justWasBlank;
  15. int xPos;
  16. int nowX;
  17. int yPos;
  18. int nowY;
  19. int movedLeft=0, movedRight=0, movedUp=0, movedDown=0;
  20.  
  21. public void setX(int x) {
  22. this.xPos = x;
  23. }
  24. public void setY(int y){
  25. this.yPos = y;
  26. }
  27. public boolean isRight(){
  28. System.out.println(this + ": X= " + this.xPos + " Y= " + this.yPos + "\n nowX= " + this.nowX + " nowY= " + this.nowY);
  29. if(this.nowX == this.xPos && this.nowY == this.yPos){
  30. rightPlace = true;
  31. }else{
  32. rightPlace = false;
  33. }
  34. return rightPlace;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement