From a586fd40db3d68cd560616bcae598692327be91e Mon Sep 17 00:00:00 2001 From: qsnow1845 Date: Tue, 21 May 2019 15:19:55 -0500 Subject: [PATCH] push for team Signed-off-by: qsnow1845 --- src/project/Colors.java | 2 ++ src/project/Draw.java | 25 ++++++++----------------- src/project/Main.java | 9 +++++++++ src/project/Sprites/player.java | 21 ++++++++++++++------- 4 files changed, 33 insertions(+), 24 deletions(-) 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 d1b7483..bb64d18 100644 --- a/src/project/Draw.java +++ b/src/project/Draw.java @@ -13,28 +13,19 @@ 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); - moveTest(g); - } - public static void moveTest(Graphics g){ - int x = 0; - while (true){ - player(g,x,200); - Expo.delay(1); - x ++; - } - } - public static void player(Graphics g, int x, int y){ - Expo.drawPoint(g,x,y); + LRbtn(g); } - - + 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){ diff --git a/src/project/Main.java b/src/project/Main.java index 9eb07bc..bcc6eeb 100644 --- a/src/project/Main.java +++ b/src/project/Main.java @@ -7,23 +7,32 @@ import java.awt.*; public class Main extends Applet { public static boolean start = false; private Rectangle startBtn = new Rectangle(100,100,340,600); + private Rectangle Lbtn = new Rectangle(100,100,340,600); + private Rectangle Rbtn = new Rectangle(100,100,340,600); 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(x+" "+y); return true; } diff --git a/src/project/Sprites/player.java b/src/project/Sprites/player.java index aa2c641..1b980f8 100644 --- a/src/project/Sprites/player.java +++ b/src/project/Sprites/player.java @@ -6,13 +6,20 @@ import java.applet.Applet; import java.awt.*; public class player extends Applet { - public static void make(Graphics g) { + public static void make(Graphics g, int x, int y) { Expo.setColor(g,colorsTemp.playerBody); - Expo.fillRectangle(g, 100, 100, 135, 160); + Expo.fillRectangle(g, x, y, x+35, y+60); 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); -} + 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