-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMoveCards.pde
92 lines (75 loc) · 1.75 KB
/
MoveCards.pde
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
static class MoveImgs {
static final String BASE = "images/Cards/Card_";
static final String F1 = BASE + "Fwd.png";
static final String F2 = BASE + "Fwd2.png";
static final String RL = BASE + "RotateLeft.png";
static final String RR = BASE + "RotateRight.png";
static final String UTURN = BASE + "Rotate180.png";
static final String SL = BASE + "StrafeLeft.png";
static final String SR = BASE + "StrafeRight.png";
static final String BACK = BASE + "Back.png";
}
class ForwardOneCard extends Card {
ForwardOneCard(int player) {
super(player, MoveImgs.F1);
}
void execute(Character c) {
c.moveForward();
}
}
class ForwardTwoCard extends Card {
ForwardTwoCard(int player) {
super(player, MoveImgs.F2);
}
void execute(Character c) {
c.moveForward2();
}
}
class RotateLeftCard extends Card {
RotateLeftCard(int player) {
super(player, MoveImgs.RL);
}
void execute(Character c) {
c.rotateLeft();
}
}
class RotateRightCard extends Card {
RotateRightCard(int player) {
super(player, MoveImgs.RR);
}
void execute(Character c) {
c.rotateRight();
}
}
class UTurnCard extends Card {
UTurnCard(int player) {
super(player, MoveImgs.UTURN);
}
void execute(Character c) {
c.rotateUTurn();
}
}
class StrafeLeftCard extends Card {
StrafeLeftCard(int player) {
super(player, MoveImgs.SL);
}
void execute(Character c) {
c.moveStrafeLeft();
}
}
class StrafeRightCard extends Card {
StrafeRightCard(int player) {
super(player, MoveImgs.SR);
}
void execute(Character c) {
c.moveStrafeRight();
}
}
class BackCard extends Card {
BackCard(int player) {
super(player, MoveImgs.BACK);
}
void execute(Character c) {
c.moveBackward();
}
}