-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComboNumber.java
More file actions
37 lines (37 loc) · 800 Bytes
/
ComboNumber.java
File metadata and controls
37 lines (37 loc) · 800 Bytes
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
class ComboNumber implements java.io.Serializable{
int x;
int y;
int value;
public ComboNumber(int x, int y, int value){
this.x = x;
this.y = y;
this.value = value;
}
public int getX(){
return x;
}
public int getY(){
return y;
}
public int getValue(){
return value;
}
public void changeXY(int addX, int addY){
this.x +=addX;
this.y +=addY;
}
public void camera(boolean north, boolean east, boolean south, boolean west, int playerVectorX, int playerVectorY){
if(north){
changeXY(0,-playerVectorY);
}
if(east){
changeXY(-playerVectorX,0);
}
if(south){
changeXY(0,-playerVectorY);
}
if(west){
changeXY(-playerVectorX,0);
}
}
}