fixed NPC spawning outside of road line. Moved power move buttons down.

Signed-off-by: officereso <qrs01@snowtx.com>
This commit is contained in:
officereso 2019-05-27 11:47:36 -05:00
parent 05eb5e46b7
commit 01de291094
9 changed files with 12 additions and 12 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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