Locomotion of player finished.
Signed-off-by: officereso <qrs01@snowtx.com>
This commit is contained in:
parent
3aa37813be
commit
1724997f4d
@ -10,4 +10,6 @@ public class Colors {
|
||||
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);
|
||||
}
|
||||
|
@ -21,6 +21,13 @@ public class Draw extends Applet {
|
||||
//project.Sprites.NPC1.NPC1(g,Expo.random(110,390));
|
||||
}
|
||||
|
||||
public static void end(Graphics g){
|
||||
Expo.setBackground(g,Colors.red);
|
||||
Expo.setColor(g,Colors.endGreen);
|
||||
Expo.drawString(g,"YOU DIED",100,100);
|
||||
}
|
||||
|
||||
|
||||
public static void LRbtn(Graphics g){
|
||||
Expo.setFont(g,"Default",1,100);
|
||||
Expo.setColor(g,Colors.startBlue);
|
||||
|
@ -5,13 +5,13 @@ import java.awt.*;
|
||||
|
||||
|
||||
public class Main extends Applet {
|
||||
public static boolean start = false;
|
||||
private 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);
|
||||
private Rectangle lBtn = new Rectangle(480,220,120,80);
|
||||
private Rectangle rBtn = new Rectangle(630,220,120,80);
|
||||
private static int Px = 150;
|
||||
|
||||
public void paint(Graphics g){
|
||||
test(g);
|
||||
Expo.drawHeading(g, "Quentin Snow and Alekkai", "Final Project");
|
||||
if (start){
|
||||
Draw.begin(g);
|
||||
@ -22,24 +22,31 @@ public class Main extends Applet {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void playerLocomotion(Graphics g){
|
||||
project.Sprites.player.make(g,124,427);
|
||||
project.Sprites.player.make(g,Px,427);
|
||||
if (Px <= 107|| Px >= 375){
|
||||
Draw.end(g);
|
||||
Px = 10000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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");
|
||||
if (lBtn.inside(x,y)){
|
||||
Px-=10;
|
||||
repaint();
|
||||
}
|
||||
if (rBtn.inside(x,y)){
|
||||
Px+=10;
|
||||
repaint();
|
||||
}
|
||||
|
||||
System.out.println(x+" "+y);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static void test(Graphics g){
|
||||
project.Sprites.NPC1.NPC1(g,Expo.random(100,400));
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC1 extends Applet {
|
||||
public static void NPC1(Graphics g, int x) {
|
||||
public static void make(Graphics g, int x) {
|
||||
Expo.setColor(g,colorsTemp.NPC1Body);
|
||||
Expo.fillRectangle(g, x, 110, x+35, 170);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
|
@ -6,7 +6,7 @@ import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC2 extends Applet {
|
||||
public static void NPC2(Graphics g) {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC2Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
|
@ -6,7 +6,7 @@ import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC3 extends Applet {
|
||||
public static void NPC3(Graphics g) {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC3Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
|
@ -6,7 +6,7 @@ import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC4 extends Applet {
|
||||
public static void NPC4(Graphics g) {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC4Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
|
@ -6,7 +6,7 @@ import java.applet.Applet;
|
||||
import java.awt.*;
|
||||
|
||||
public class NPC5 extends Applet {
|
||||
public static void NPC5(Graphics g) {
|
||||
public static void make(Graphics g) {
|
||||
Expo.setColor(g,colorsTemp.NPC5Body);
|
||||
Expo.fillRectangle(g, 100, 100, 135, 160);
|
||||
Expo.setColor(g,colorsTemp.Tires);
|
||||
|
@ -1,5 +0,0 @@
|
||||
package project.tests;
|
||||
|
||||
public class movementTest {
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user