Cleaned code
Signed-off-by: officereso <qrs01@snowtx.com>
This commit is contained in:
parent
be3b16cd7b
commit
a96a7dec98
@ -7,8 +7,6 @@ import java.awt.*;
|
||||
public class Colors {
|
||||
static final Color roadGrey = new Color(68,68,68);
|
||||
static final Color lineWhite = new Color(235, 235, 235);
|
||||
static final Color lineYellow = new Color(218, 190, 93);
|
||||
static final Color startGreen = new Color(13, 255, 0);
|
||||
static final Color startBlue = new Color(112, 113, 255);
|
||||
static final Color red = new Color(255, 6, 0);
|
||||
static final Color endGreen = new Color(150, 255, 0);
|
||||
|
@ -1,5 +1,3 @@
|
||||
// This module was created by Quentin Snow
|
||||
|
||||
package project;
|
||||
|
||||
import java.applet.Applet;
|
||||
|
@ -5,8 +5,7 @@ package project;// THE EXPO CLASS FOR INTRO/CP COMPUTER SCIENCE
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import java.applet.Applet;
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -307,7 +306,7 @@ public class Expo
|
||||
case 8 : g.setColor(gray); currentColor = gray; break;
|
||||
case 9 : g.setColor(pink); currentColor = pink; break;
|
||||
default : g.setColor(white);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -647,8 +646,8 @@ public class Expo
|
||||
**/
|
||||
public static void drawRegularPolygon(Graphics g, int centerX, int centerY, int radius, int sides)
|
||||
{
|
||||
int xCoord[] = new int[sides];
|
||||
int yCoord[] = new int[sides];
|
||||
int[] xCoord = new int[sides];
|
||||
int[] yCoord = new int[sides];
|
||||
|
||||
double rotate;
|
||||
if (sides % 2 == 1)
|
||||
@ -682,8 +681,8 @@ public class Expo
|
||||
int p = points;
|
||||
points *= 2;
|
||||
|
||||
int xCoord[] = new int[points];
|
||||
int yCoord[] = new int[points];
|
||||
int[] xCoord = new int[points];
|
||||
int[] yCoord = new int[points];
|
||||
|
||||
int currentRadius;
|
||||
|
||||
@ -839,8 +838,8 @@ public class Expo
|
||||
**/
|
||||
public static void fillRegularPolygon(Graphics g, int centerX, int centerY, int radius, int sides)
|
||||
{
|
||||
int xCoord[] = new int[sides];
|
||||
int yCoord[] = new int[sides];
|
||||
int[] xCoord = new int[sides];
|
||||
int[] yCoord = new int[sides];
|
||||
|
||||
double rotate;
|
||||
if (sides % 2 == 1)
|
||||
@ -902,8 +901,8 @@ public class Expo
|
||||
int p = points;
|
||||
points *= 2;
|
||||
|
||||
int xCoord[] = new int[points];
|
||||
int yCoord[] = new int[points];
|
||||
int[] xCoord = new int[points];
|
||||
int[] yCoord = new int[points];
|
||||
|
||||
int currentRadius;
|
||||
|
||||
|
@ -12,7 +12,6 @@ public class Main extends Applet {
|
||||
private Rectangle lBtn = new Rectangle(480,220,120,80);
|
||||
private Rectangle rBtn = new Rectangle(630,220,120,80);
|
||||
private static int Px = 150;
|
||||
private static boolean btnException = true;
|
||||
private static boolean spwNpc1, spwNpc2 = true;
|
||||
|
||||
public void paint(Graphics g){
|
||||
@ -50,7 +49,6 @@ public class Main extends Applet {
|
||||
|
||||
|
||||
public boolean mouseDown(Event e, int x, int y){
|
||||
btnException = true;
|
||||
if (startBtn.inside(x,y)){
|
||||
start = true;
|
||||
}
|
||||
@ -60,8 +58,6 @@ public class Main extends Applet {
|
||||
if (rBtn.inside(x,y)){
|
||||
Px+=10;
|
||||
}
|
||||
|
||||
btnException = false;
|
||||
repaint();
|
||||
System.out.println(x+" "+y);
|
||||
return true;
|
||||
|
@ -1,37 +1,32 @@
|
||||
package project.Sprites;
|
||||
|
||||
import project.Colors;
|
||||
import project.Expo;
|
||||
|
||||
import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC extends Thread {
|
||||
public class NPC extends Applet {
|
||||
public NPC(Graphics g) {
|
||||
int x = Expo.random(100,400);
|
||||
Expo.setColor(g,colorsTemp.NPC1Body);
|
||||
Expo.fillRectangle(g, x, 110, x+35, 170);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
Expo.fillRectangle(g, x+5, 118, x-5, 138);
|
||||
Expo.fillRectangle(g, x+5, 145, x-5, 165);
|
||||
Expo.fillRectangle(g, x+30, 118, x+40, 138);
|
||||
Expo.fillRectangle(g, x+30, 145, x+40, 165);
|
||||
int x = Expo.random(100, 400);
|
||||
Expo.setColor(g, SpriteColors.NPC1Body);
|
||||
Expo.fillRectangle(g, x, 110, x + 35, 170);
|
||||
Expo.setColor(g, SpriteColors.Tires);
|
||||
Expo.fillRectangle(g, x + 5, 118, x - 5, 138);
|
||||
Expo.fillRectangle(g, x + 5, 145, x - 5, 165);
|
||||
Expo.fillRectangle(g, x + 30, 118, x + 40, 138);
|
||||
Expo.fillRectangle(g, x + 30, 145, x + 40, 165);
|
||||
}
|
||||
}
|
||||
/*
|
||||
public static void make(Graphics g){
|
||||
int x = Expo.random(100,400);
|
||||
Expo.setColor(g,colorsTemp.NPC1Body);
|
||||
Expo.setColor(g,SpriteColors.NPC1Body);
|
||||
Expo.fillRectangle(g, x, 110, x+35, 170);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
Expo.setColor(g,SpriteColors.Tires);
|
||||
Expo.fillRectangle(g, x+5, 118, x-5, 138);
|
||||
Expo.fillRectangle(g, x+5, 145, x-5, 165);
|
||||
Expo.fillRectangle(g, x+30, 118, x+40, 138);
|
||||
Expo.fillRectangle(g, x+30, 145, x+40, 165);
|
||||
|
||||
}
|
||||
}
|
||||
// Expo.setColor(g,colorsTemp.NPC1Body);
|
||||
// Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
// Expo.setColor(g,colorsTemp.Tires);
|
||||
// Expo.fillRectangle(g, 105, 108, 95, 128);
|
||||
// Expo.fillRectangle(g, 105, 135, 95, 155);
|
||||
// Expo.fillRectangle(g, 130, 108, 140, 128);
|
||||
// Expo.fillRectangle(g, 130, 135, 140, 155);
|
||||
}*/
|
||||
|
@ -1,18 +0,0 @@
|
||||
package project.Sprites;
|
||||
|
||||
import project.Colors;
|
||||
import project.Expo;
|
||||
import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC2 extends Applet {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC2Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
Expo.fillRectangle(g, 105, 108, 95, 128);
|
||||
Expo.fillRectangle(g, 105, 135, 95, 155);
|
||||
Expo.fillRectangle(g, 130, 108, 140, 128);
|
||||
Expo.fillRectangle(g, 130, 135, 140, 155);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package project.Sprites;
|
||||
|
||||
import project.Colors;
|
||||
import project.Expo;
|
||||
import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC3 extends Applet {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC3Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
Expo.fillRectangle(g, 105, 108, 95, 128);
|
||||
Expo.fillRectangle(g, 105, 135, 95, 155);
|
||||
Expo.fillRectangle(g, 130, 108, 140, 128);
|
||||
Expo.fillRectangle(g, 130, 135, 140, 155);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package project.Sprites;
|
||||
|
||||
import project.Colors;
|
||||
import project.Expo;
|
||||
import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC4 extends Applet {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC4Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
Expo.fillRectangle(g, 105, 108, 95, 128);
|
||||
Expo.fillRectangle(g, 105, 135, 95, 155);
|
||||
Expo.fillRectangle(g, 130, 108, 140, 128);
|
||||
Expo.fillRectangle(g, 130, 135, 140, 155);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package project.Sprites;
|
||||
|
||||
import project.Colors;
|
||||
import project.Expo;
|
||||
import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC5 extends Applet {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC5Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
Expo.fillRectangle(g, 105, 108, 95, 128);
|
||||
Expo.fillRectangle(g, 105, 135, 95, 155);
|
||||
Expo.fillRectangle(g, 130, 108, 140, 128);
|
||||
Expo.fillRectangle(g, 130, 135, 140, 155);
|
||||
}
|
||||
}
|
9
src/project/Sprites/SpriteColors.java
Normal file
9
src/project/Sprites/SpriteColors.java
Normal file
@ -0,0 +1,9 @@
|
||||
package project.Sprites;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class SpriteColors {
|
||||
static final Color playerBody = new Color(247, 17, 17);
|
||||
static final Color Tires = new Color(0, 0, 0);
|
||||
static final Color NPC1Body = new Color(0, 247, 0);
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package project.Sprites;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class colorsTemp {
|
||||
static final Color roadGrey = new Color(68,68,68);
|
||||
static final Color lineWhite = new Color(235, 235, 235);
|
||||
static final Color lineYellow = new Color(218, 190, 93);
|
||||
static final Color startGreen = new Color(13, 255, 0);
|
||||
static final Color startBlue = new Color(112, 113, 255);
|
||||
static final Color playerBody = new Color(247, 17, 17);
|
||||
static final Color Tires = new Color(0, 0, 0);
|
||||
static final Color NPC1Body = new Color(0, 247, 0);
|
||||
static final Color NPC2Body = new Color(221, 247, 0);
|
||||
static final Color NPC3Body = new Color(247, 113, 0);
|
||||
static final Color NPC4Body = new Color(0, 11, 247);
|
||||
static final Color NPC5Body = new Color(247, 0, 182);
|
||||
}
|
@ -1,24 +1,24 @@
|
||||
package project.Sprites;
|
||||
|
||||
import project.Colors;
|
||||
import project.Expo;
|
||||
|
||||
import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class player extends Applet {
|
||||
public static void make(Graphics g, int x, int y) {
|
||||
Expo.setColor(g,colorsTemp.playerBody);
|
||||
Expo.setColor(g, SpriteColors.playerBody);
|
||||
Expo.fillRectangle(g, x, y, x+35, y+60);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
Expo.setColor(g, SpriteColors.Tires);
|
||||
Expo.fillRectangle(g, x+5, y+8, x-5, y+28);
|
||||
Expo.fillRectangle(g, x+5, y+35, x-5, y+55);
|
||||
Expo.fillRectangle(g, x+30, y+8, x+40, y+28);
|
||||
Expo.fillRectangle(g, x+30, y+35, x+40, y+55);
|
||||
}
|
||||
}
|
||||
// Expo.setColor(g,colorsTemp.playerBody);
|
||||
// Expo.setColor(g,SpriteColors.playerBody);
|
||||
// Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
// Expo.setColor(g,colorsTemp.Tires);
|
||||
// Expo.setColor(g,SpriteColors.Tires);
|
||||
// Expo.fillRectangle(g, 105, 108, 95, 128);
|
||||
// Expo.fillRectangle(g, 105, 135, 95, 155);
|
||||
// Expo.fillRectangle(g, 130, 108, 140, 128);
|
||||
|
Loading…
x
Reference in New Issue
Block a user