-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLottery
53 lines (35 loc) · 867 Bytes
/
Lottery
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
String url = "https://geraniumodorant.com/wp-content/uploads/2016/04/scents-roses.png";
Sprite s = new Sprite(url, 320, 240, 50, 50);
Boolean turnClockwise = true;
void draw() {
fill(0, 0, 0, 20);
rect(320, 240, 640, 480);
fill(255, 0, 0, 20);
rect(480, 360, 320, 240);
fill(0, 255, 0, 20);
rect(160, 360, 320, 240);
fill(0, 0, 255, 20);
rect(480, 120, 320, 240);
fill(255, 255, 0, 20);
rect(160, 120, 320, 240);
fill(255, 255, 255, 20);
rect(320, 120, 20, 240);
s.moveToPoint(320, 240);
s.forward(200);
s.display();
if (turnClockwise == true) {
s.turn(23);
} else {
if (s.touchingPoint(320, 40)) {
println("you win!");
}
if (s.getX() < 320) {
println("+1");
} else {
println("-1");
}
}
}
void mousePressed() {
turnClockwise = !turnClockwise;
}