Cleaned up some access can be private warnings in Main.java and more code cleanup.

Signed-off-by: officereso <qrs01@snowtx.com>
This commit is contained in:
officereso 2019-05-24 21:30:20 -05:00
parent 7fba7e16e2
commit b5ed376176
2 changed files with 21 additions and 19 deletions

View File

@ -2,6 +2,7 @@
<dictionary name="freeman"> <dictionary name="freeman">
<words> <words>
<w>alekkai</w> <w>alekkai</w>
<w>btns</w>
</words> </words>
</dictionary> </dictionary>
</component> </component>

View File

@ -9,12 +9,29 @@ import java.awt.*;
public class Main extends Applet { public class Main extends Applet {
private static boolean start = false; private static boolean start = false;
private Rectangle startBtn = new Rectangle(100,100,340,600); private Rectangle startBtn = new Rectangle(100,100,340,600);
public static int score = 0; private static int score = 0;
private Rectangle lBtn = new Rectangle(480, 240, 150, 80); private Rectangle lBtn = new Rectangle(480, 240, 150, 80);
private static int Px = 150; private static int Px = 150;
private Rectangle rBtn = new Rectangle(660, 240, 150, 80); private Rectangle rBtn = new Rectangle(660, 240, 150, 80);
public static void npcLocomotion(Graphics g) { public void paint(Graphics g) {
Expo.drawHeading(g, "Quentin Snow and Alekkai", "Final Project");
if (start && !NPC1.ended && !NPC2.ended && !NPC3.ended && !NPC4.ended && !NPC5.ended && !NPC6.ended) {
Draw.begin(g, score);
playerLocomotion(g);
npcLocomotion(g);
}
if (!start) {
Draw.startScreen(g);
}
if (NPC1.ended || NPC2.ended || NPC3.ended || NPC4.ended || NPC5.ended || NPC6.ended) {
Draw.end(g);
}
}
private static void npcLocomotion(Graphics g) {
if (score > 3) { if (score > 3) {
new NPC1(g, Px); new NPC1(g, Px);
} }
@ -36,7 +53,7 @@ public class Main extends Applet {
} }
public static void playerLocomotion(Graphics g) { private static void playerLocomotion(Graphics g) {
project.Sprites.player.make(g, Px, 427); project.Sprites.player.make(g, Px, 427);
if (Px <= 107 || Px >= 375) { if (Px <= 107 || Px >= 375) {
Draw.end(g); Draw.end(g);
@ -44,22 +61,6 @@ public class Main extends Applet {
} }
} }
public void paint(Graphics g) {
Expo.drawHeading(g, "Quentin Snow and Alekkai", "Final Project");
if (start && !NPC1.ended && !NPC2.ended && !NPC3.ended && !NPC4.ended && !NPC5.ended && !NPC6.ended) {
Draw.begin(g, score);
playerLocomotion(g);
npcLocomotion(g);
}
if (!start) {
Draw.startScreen(g);
}
if (NPC1.ended || NPC2.ended || NPC3.ended || NPC4.ended || NPC5.ended || NPC6.ended) {
Draw.end(g);
}
}
public boolean mouseDown(Event e, int x, int y){ public boolean mouseDown(Event e, int x, int y){
if (startBtn.inside(x,y)){ if (startBtn.inside(x,y)){