From 01de2910949a25af39833203d9133eb615776d28 Mon Sep 17 00:00:00 2001 From: officereso Date: Mon, 27 May 2019 11:47:36 -0500 Subject: [PATCH] fixed NPC spawning outside of road line. Moved power move buttons down. Signed-off-by: officereso --- src/project/Draw.java | 6 +++--- src/project/Main.java | 4 ++-- src/project/Sprites/NPC1.java | 2 +- src/project/Sprites/NPC2.java | 2 +- src/project/Sprites/NPC3.java | 2 +- src/project/Sprites/NPC4.java | 2 +- src/project/Sprites/NPC5.java | 2 +- src/project/Sprites/NPC6.java | 2 +- src/project/Sprites/NPC7.java | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/project/Draw.java b/src/project/Draw.java index 18a1333..9828fba 100644 --- a/src/project/Draw.java +++ b/src/project/Draw.java @@ -43,10 +43,10 @@ public class Draw extends Applet { public static void pBtn(Graphics g) { Expo.setFont(g, "Arial", 1, 100); Expo.setColor(g, Colors.pBtn); - Expo.drawString(g, "<=", 480, 400); - Expo.drawString(g, "=>", 660, 400); + Expo.drawString(g, "<=", 480, 700); + Expo.drawString(g, "=>", 660, 700); Expo.setFont(g, "Arial", 1, 20); - Expo.drawString(g, "Power move! Click the buttons bellow to move five times as far!", 450, 335); + Expo.drawString(g, "Power move! Click the buttons bellow to move five times as far!", 450, 635); } diff --git a/src/project/Main.java b/src/project/Main.java index cbf5241..fcc357b 100644 --- a/src/project/Main.java +++ b/src/project/Main.java @@ -14,8 +14,8 @@ public class Main extends Applet { private Rectangle startBtn = new Rectangle(100, 100, 340, 600); // Rectangle that the user presses to start the game private Rectangle lBtn = new Rectangle(480, 240, 150, 80); // Rectangle that the player presses to move player to the left private Rectangle rBtn = new Rectangle(660, 240, 150, 80); // Rectangle that the player presses to move player to the right - private Rectangle lpBtn = new Rectangle(480, 340, 150, 80); // Rectangle that the player presses to move player to the power left - private Rectangle rpBtn = new Rectangle(660, 340, 150, 80); // Rectangle that the player presses to move player to the power right + private Rectangle lpBtn = new Rectangle(480, 640, 150, 80); // Rectangle that the player presses to move player to the power left + private Rectangle rpBtn = new Rectangle(660, 640, 150, 80); // Rectangle that the player presses to move player to the power right private boolean alive = true; // Used to stop score from increasing private boolean powerUsed = true; // Sets default value for power availability diff --git a/src/project/Sprites/NPC1.java b/src/project/Sprites/NPC1.java index 90bf96d..6778cd9 100644 --- a/src/project/Sprites/NPC1.java +++ b/src/project/Sprites/NPC1.java @@ -7,7 +7,7 @@ import java.awt.*; public class NPC1 extends Applet { public static boolean collision = false; - private static int x = Expo.random(100, 400); // Where NPC starts on road + private static int x = Expo.random(100, 350); // Where NPC starts on road private static int y = -15; // Default starting position for NPC. Negative because NPC is draw from bottom left to top right. private static int speed = Expo.random(10, 40); // Value to move NPC down diff --git a/src/project/Sprites/NPC2.java b/src/project/Sprites/NPC2.java index 4ccf732..aff5bfe 100644 --- a/src/project/Sprites/NPC2.java +++ b/src/project/Sprites/NPC2.java @@ -7,7 +7,7 @@ import java.awt.*; public class NPC2 extends Applet { public static boolean collision = false; - private static int x = Expo.random(100, 400); // Where NPC starts on road + private static int x = Expo.random(100, 350); // Where NPC starts on road private static int y = -15; // Default starting position for NPC. Negative because NPC is draw from bottom left to top right. private static int speed = Expo.random(10, 40); // Value to move NPC down diff --git a/src/project/Sprites/NPC3.java b/src/project/Sprites/NPC3.java index e723c89..414973e 100644 --- a/src/project/Sprites/NPC3.java +++ b/src/project/Sprites/NPC3.java @@ -7,7 +7,7 @@ import java.awt.*; public class NPC3 extends Applet { public static boolean collision = false; - private static int x = Expo.random(100, 400); // Where NPC starts on road + private static int x = Expo.random(100, 350); // Where NPC starts on road private static int y = -15; // Default starting position for NPC. Negative because NPC is draw from bottom left to top right. private static int speed = Expo.random(10, 40); // Value to move NPC down diff --git a/src/project/Sprites/NPC4.java b/src/project/Sprites/NPC4.java index fc73fb2..cb451fe 100644 --- a/src/project/Sprites/NPC4.java +++ b/src/project/Sprites/NPC4.java @@ -7,7 +7,7 @@ import java.awt.*; public class NPC4 extends Applet { public static boolean collision = false; - private static int x = Expo.random(100, 400); // Where NPC starts on road + private static int x = Expo.random(100, 350); // Where NPC starts on road private static int y = -15; // Default starting position for NPC. Negative because NPC is draw from bottom left to top right. private static int speed = Expo.random(10, 40); // Value to move NPC down diff --git a/src/project/Sprites/NPC5.java b/src/project/Sprites/NPC5.java index 495fe65..e77be09 100644 --- a/src/project/Sprites/NPC5.java +++ b/src/project/Sprites/NPC5.java @@ -7,7 +7,7 @@ import java.awt.*; public class NPC5 extends Applet { public static boolean collision = false; - private static int x = Expo.random(100, 400); // Where NPC starts on road + private static int x = Expo.random(100, 350); // Where NPC starts on road private static int y = -15; // Default starting position for NPC. Negative because NPC is draw from bottom left to top right. private static int speed = Expo.random(10, 40); // Value to move NPC down diff --git a/src/project/Sprites/NPC6.java b/src/project/Sprites/NPC6.java index f9aed62..0a197ac 100644 --- a/src/project/Sprites/NPC6.java +++ b/src/project/Sprites/NPC6.java @@ -7,7 +7,7 @@ import java.awt.*; public class NPC6 extends Applet { public static boolean collision = false; - private static int x = Expo.random(100, 400); // Where NPC starts on road + private static int x = Expo.random(100, 350); // Where NPC starts on road private static int y = -15; // Default starting position for NPC. Negative because NPC is draw from bottom left to top right. private static int speed = Expo.random(10, 40); // Value to move NPC down diff --git a/src/project/Sprites/NPC7.java b/src/project/Sprites/NPC7.java index 0bac1e3..9196b23 100644 --- a/src/project/Sprites/NPC7.java +++ b/src/project/Sprites/NPC7.java @@ -7,7 +7,7 @@ import java.awt.*; public class NPC7 extends Applet { public static boolean collision = false; - private static int x = Expo.random(100, 400); // Where NPC starts on road + private static int x = Expo.random(100, 350); // Where NPC starts on road private static int y = -15; // Default starting position for NPC. Negative because NPC is draw from bottom left to top right. private static int speed = Expo.random(60, 100); // Value to move NPC down