diff --git a/src/project/Colors.java b/src/project/Colors.java index ef4c1f2..ec18e11 100644 --- a/src/project/Colors.java +++ b/src/project/Colors.java @@ -1,3 +1,5 @@ +// This module was made by Quentin Snow + package project; import java.awt.*; diff --git a/src/project/Draw.java b/src/project/Draw.java index e37102c..fd9f55d 100644 --- a/src/project/Draw.java +++ b/src/project/Draw.java @@ -1,3 +1,5 @@ +// This module was created by Quentin Snow + package project; import java.applet.Applet; @@ -11,10 +13,22 @@ public class Draw extends Applet { Expo.setFont(g,"Default",1,100-i); Expo.drawString(g,"START",100+i*5,200+i*7); } - - - } + + public static void begin(Graphics g){ + road(g); + LRbtn(g); + //project.Sprites.NPC1.NPC1(g,Expo.random(110,390)); + } + + public static void LRbtn(Graphics g){ + Expo.setFont(g,"Default",1,100); + Expo.setColor(g,Colors.startBlue); + Expo.drawString(g,"<=",480,300); + Expo.drawString(g,"=>",620,300); + } + + public static void road(Graphics g){ Expo.fillRoundedRectangle(g,100,100,410,500,6); Expo.setColor(g,Colors.roadGrey); diff --git a/src/project/Main.java b/src/project/Main.java index 77de0ec..f1638d7 100644 --- a/src/project/Main.java +++ b/src/project/Main.java @@ -5,11 +5,41 @@ import java.awt.*; public class Main extends Applet { - public void paint(Graphics g){ - Expo.drawHeading(g, "Quentin Snow and Alekkai", "Final Project"); - Draw.startScreen(g); - // Draw.road(g); - // project.Sprites.player.make(g); + public static boolean start = false; + private Rectangle startBtn = new Rectangle(100,100,340,600); + private Rectangle Lbtn = new Rectangle(480,220,120,80); + private Rectangle Rbtn = new Rectangle(530,220,120,80); + public void paint(Graphics g){ + test(g); + Expo.drawHeading(g, "Quentin Snow and Alekkai", "Final Project"); + if (start){ + Draw.begin(g); + playerLocomotion(g); + } + else{ + Draw.startScreen(g); + } + } + + public static void playerLocomotion(Graphics g){ + project.Sprites.player.make(g,124,427); + } + + public boolean mouseDown(Event e, int x, int y){ + if (startBtn.inside(x,y)){ + start = true; + repaint(); + } + if (Lbtn.inside(x,y)){ + System.out.println("inside lbtn"); + } + System.out.println(x+" "+y); + return true; + } + + + public static void test(Graphics g){ + project.Sprites.NPC1.NPC1(g,Expo.random(100,400)); } } diff --git a/src/project/Sprites/NPC1.java b/src/project/Sprites/NPC1.java new file mode 100644 index 0000000..85e9070 --- /dev/null +++ b/src/project/Sprites/NPC1.java @@ -0,0 +1,25 @@ +package project.Sprites; + +import project.Colors; +import project.Expo; +import java.applet.Applet; +import java.awt.*; + +public class NPC1 extends Applet { + public static void NPC1(Graphics g, int x) { + 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); + } +} +// 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); \ No newline at end of file diff --git a/src/project/Sprites/NPC2.java b/src/project/Sprites/NPC2.java new file mode 100644 index 0000000..2ae9424 --- /dev/null +++ b/src/project/Sprites/NPC2.java @@ -0,0 +1,18 @@ +package project.Sprites; + +import project.Colors; +import project.Expo; +import java.applet.Applet; +import java.awt.*; + +public class NPC2 extends Applet { + public static void NPC2(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); + } +} diff --git a/src/project/Sprites/NPC3.java b/src/project/Sprites/NPC3.java new file mode 100644 index 0000000..39f7046 --- /dev/null +++ b/src/project/Sprites/NPC3.java @@ -0,0 +1,18 @@ +package project.Sprites; + +import project.Colors; +import project.Expo; +import java.applet.Applet; +import java.awt.*; + +public class NPC3 extends Applet { + public static void NPC3(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); + } +} diff --git a/src/project/Sprites/NPC4.java b/src/project/Sprites/NPC4.java new file mode 100644 index 0000000..27eb2d6 --- /dev/null +++ b/src/project/Sprites/NPC4.java @@ -0,0 +1,18 @@ +package project.Sprites; + +import project.Colors; +import project.Expo; +import java.applet.Applet; +import java.awt.*; + +public class NPC4 extends Applet { + public static void NPC4(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); + } +} diff --git a/src/project/Sprites/NPC5.java b/src/project/Sprites/NPC5.java new file mode 100644 index 0000000..ef3c440 --- /dev/null +++ b/src/project/Sprites/NPC5.java @@ -0,0 +1,18 @@ +package project.Sprites; + +import project.Colors; +import project.Expo; +import java.applet.Applet; +import java.awt.*; + +public class NPC5 extends Applet { + public static void NPC5(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); + } +} diff --git a/src/project/Sprites/colorsTemp.java b/src/project/Sprites/colorsTemp.java new file mode 100644 index 0000000..20aee72 --- /dev/null +++ b/src/project/Sprites/colorsTemp.java @@ -0,0 +1,18 @@ +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); +} diff --git a/src/project/Sprites/player.java b/src/project/Sprites/player.java index 493c96b..1b980f8 100644 --- a/src/project/Sprites/player.java +++ b/src/project/Sprites/player.java @@ -1,12 +1,25 @@ package project.Sprites; +import project.Colors; import project.Expo; import java.applet.Applet; import java.awt.*; public class player extends Applet { - public static void draw(Graphics g, int x1, int y1){ - Expo.fillRectangle(g,100,100,125,150); - Expo.fillRectangle(g,105,110,95,120); + public static void make(Graphics g, int x, int y) { + Expo.setColor(g,colorsTemp.playerBody); + Expo.fillRectangle(g, x, y, x+35, y+60); + Expo.setColor(g,colorsTemp.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.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); \ No newline at end of file