SHARE
TWEET

Untitled

a guest Oct 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ClickPane extends WinPane {
  2.     private int gg = 1;
  3.     Turtle Olya = new Turtle();
  4.     double xStart = this.getX();
  5.     double yStart = this.getY();
  6.  
  7.     protected void onMousePressed(int x, int y, MouseEvent detail) {
  8.         if ((detail.getButton()) == MouseEvent.BUTTON1) {
  9.             if (gg == 1) {
  10.                 String number =Integer.toString(gg);
  11.                 Olya.setPosition(x, y);
  12.                 Olya.dot(10);
  13.                 Olya.moveTo(x, y);
  14.                 Olya.printCenter(number);
  15.                 gg++;
  16.             }
  17.             if (!(gg == 1)) {
  18.                 Olya.setPosition(xStart, yStart);
  19.             } else {
  20.                 Olya.moveTo(x, y);
  21.                 Olya.dot(10);
  22.             }
  23.         }
  24.     }
  25.  
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top