-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSquarePlay.java
More file actions
107 lines (73 loc) · 2.09 KB
/
SquarePlay.java
File metadata and controls
107 lines (73 loc) · 2.09 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package com.example.squareplay;
import android.util.DisplayMetrics;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ProgressBar;
import androidx.constraintlayout.widget.ConstraintSet;
import androidx.core.view.GestureDetectorCompat;
public class SquarePlay extends MainActivity {
private int currentSwaps;
private int score;
private int currentGoal;
public SquarePlay() throws ClassNotFoundException, NoSuchMethodException {
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public int getCurrentSwaps() {
return currentSwaps;
}
public void setCurrentSwaps(int currentSwaps) {
this.currentSwaps = currentSwaps;
}
public int getCurrentGoal() {
return currentGoal;
}
public void setCurrentGoal(int currentGoal) {
this.currentGoal = currentGoal;
}
/* float x1, x2, y1, y2, dx, dy;
public void onSwipeEvent(MotionEvent event){
switch(event.getAction()) {
case(MotionEvent.ACTION_DOWN):
x1 = event.getX();
y1 = event.getY();
break;
case(MotionEvent.ACTION_UP): {
x2 = event.getX();
y2 = event.getY();
dx = x2-x1;
dy = y2-y1;
if(Math.abs(dx) > Math.abs(dy)) {
if(dx>0)
onSwipeRight();
else
onSwipeLeft();
} else {
if(dy>0)
onSwipeDown();
else
onSwipeUp();
}
}
}
}
private void onSwipeLeft() {
System.exit(0);
}
private void onSwipeRight() {
System.exit(0);
}
private void onSwipeUp() {
System.exit(0);
}
private void onSwipeDown() {
System.exit(0);
}
private void makeMove(Cell c1, Cell c2) {
}*/
}