-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFighter.java
More file actions
242 lines (224 loc) · 4.9 KB
/
Copy pathFighter.java
File metadata and controls
242 lines (224 loc) · 4.9 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.*;
import javafx.scene.media.AudioClip;
import java.net.URL;
import javafx.application.Application;
import javafx.geometry.Rectangle2D;
import javafx.event.*;
import javafx.scene.input.*;
import javafx.scene.text.*;
public class Fighter{
private int health, maxHealth, damage, speed, xPos, yPos;
private double critChance, maxCrit;
private Image start, punch, kick, crouch, startL, punchL, kickL, crouchL, dead;
private boolean left;
private boolean isJumping;
private int jumpTime, jumpSpeed;
private boolean isPunching, isKicking;
private int punchDelay, kickDelay, punchTime, kickTime;
private boolean demobilized;
private int demobilizedTime, demobilizedDelay;
private boolean atBounds;
private boolean hasFireball;//NEW
public Fighter(boolean l){
health = 3000;
maxHealth = 3000;
damage = 5;
speed = 10;
critChance = .2;
maxCrit = 3;
isJumping = false;
isPunching = false;
isKicking = false;
demobilized = false;
atBounds = false;
jumpTime = 0;
jumpSpeed = 10;
dead = new Image("defaultDead.png");
if(l) {
start = new Image("defaultStart.png");
punch = new Image("defaultPunch.png");
kick = new Image("defaultKick.png");
crouch = new Image("defaultCrouch.png");
startL = new Image("defaultStartL.png");
punchL = new Image("defaultPunchL.png");
kickL = new Image("defaultKickL.png");
crouchL = new Image("defaultCrouchL.PNG");
}
else {
startL = new Image("defaultStart.png");
punchL = new Image("defaultPunch.png");
kickL = new Image("defaultKick.png");
crouchL = new Image("defaultCrouch.png");
start = new Image("defaultStartL.png");
punch = new Image("defaultPunchL.png");
kick = new Image("defaultKickL.png");
crouch = new Image("defaultCrouchL.PNG");
}
}
//Images
public Image getStart(){
if(left)
return startL;
return start;
}
public Image getPunch(){
if(left)
return punchL;
return punch;
}
public Image getKick(){
if(left)
return kickL;
return kick;
}
public Image getCrouch(){
if(left)
return crouchL;
return crouch;
}
public Image getDead(){
return dead;
}
public boolean getLeft(){
return left;
}
public void setLeft(boolean b){
left = b;
}
//stuff thats happening
public int getSpeed(){
return speed;
}
public int getXpos(){
return xPos;
}
public int getYpos(){
return yPos;
}
//Movement
public void move(double x, double y){
xPos -= x;
yPos += y;
}
public void setYpos(int y){
yPos = y;
}
public void setXpos(int x){
xPos = x;
}
public boolean getIsJumping(){
return isJumping;
}
public int getJumpTime(){
return jumpTime;
}
public int getJumpSpeed(){
return jumpSpeed;
}
public void setIsJumping(boolean b){
isJumping = b;
}
public void setJumpTime(int b){
jumpTime = b;
}
public void setJumpSpeed(int b){
jumpSpeed = b;
}
//Punches and Kicks
public boolean isPunching(){
return isPunching;
}
public boolean isKicking(){
return isKicking;
}
public void setPunching(boolean b){
isPunching = b;
}
public void setKicking(boolean b){
isKicking = b;
}
public int getPunchDelay(){
return punchDelay;
}
public void setPunchDelay(int x){
punchDelay = x;
}
public int getKickDelay(){
return kickDelay;
}
public void setKickDelay(int x){
kickDelay = x;
}
public int getPunchTime(){
return punchTime;
}
public void setPunchTime(int x){
punchTime = x;
}
public int getKickTime(){
return kickTime;
}
public void setKickTime(int x){
kickTime = x;
}
//Health and damage
public int getHealth(){
return health;
}
public int getMaxHealth(){
return maxHealth;
}
public void setHealth(int x){
health = x;
}
public int getDamage(){
return damage;
}
public double getCritChance(){
return critChance;
}
public double getMaxCrit(){
return maxCrit;
}
//demobilzed
public boolean getDemobilized(){
return demobilized;
}
public void setDemobilized(boolean b){
demobilized = b;
}
public int getDemTime(){
return demobilizedTime;
}
public void setDemTime(int t){
demobilizedTime = t;
}
public int getDemDelay(){
return demobilizedDelay;
}
public void setDemDelay(int t){
demobilizedDelay = t;
}
//bounds
public boolean getAtBounds(){
return atBounds;
}
public void setAtBounds(boolean b){
atBounds = b;
}
public boolean getFireball(){ //NEW
return hasFireball;
}
public void setFireball(boolean b){
hasFireball = b;
}
}