NPC spawning started
Signed-off-by: officereso <qrs01@snowtx.com>
This commit is contained in:
parent
a6ab0c9347
commit
be3b16cd7b
@ -18,7 +18,7 @@ public class Draw extends Applet {
|
|||||||
public static void begin(Graphics g){
|
public static void begin(Graphics g){
|
||||||
road(g);
|
road(g);
|
||||||
LRbtn(g);
|
LRbtn(g);
|
||||||
//project.Sprites.NPC1.NPC1(g,Expo.random(110,390));
|
//project.Sprites.NPC.NPC(g,Expo.random(110,390));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void end(Graphics g){
|
public static void end(Graphics g){
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package project;
|
package project;
|
||||||
|
|
||||||
|
import project.Sprites.NPC;
|
||||||
|
|
||||||
import java.applet.Applet;
|
import java.applet.Applet;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
@ -10,6 +12,8 @@ public class Main extends Applet {
|
|||||||
private Rectangle lBtn = new Rectangle(480,220,120,80);
|
private Rectangle lBtn = new Rectangle(480,220,120,80);
|
||||||
private Rectangle rBtn = new Rectangle(630,220,120,80);
|
private Rectangle rBtn = new Rectangle(630,220,120,80);
|
||||||
private static int Px = 150;
|
private static int Px = 150;
|
||||||
|
private static boolean btnException = true;
|
||||||
|
private static boolean spwNpc1, spwNpc2 = true;
|
||||||
|
|
||||||
public void paint(Graphics g){
|
public void paint(Graphics g){
|
||||||
Expo.drawHeading(g, "Quentin Snow and Alekkai", "Final Project");
|
Expo.drawHeading(g, "Quentin Snow and Alekkai", "Final Project");
|
||||||
@ -17,6 +21,7 @@ public class Main extends Applet {
|
|||||||
Draw.begin(g);
|
Draw.begin(g);
|
||||||
playerLocomotion(g);
|
playerLocomotion(g);
|
||||||
npcLocomotion(g);
|
npcLocomotion(g);
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Draw.startScreen(g);
|
Draw.startScreen(g);
|
||||||
@ -33,30 +38,31 @@ public class Main extends Applet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void npcLocomotion(Graphics g){
|
public static void npcLocomotion(Graphics g){
|
||||||
project.Sprites.NPC1 npc1 = new project.Sprites.NPC1(g);
|
if (spwNpc1){
|
||||||
int v = 70;
|
NPC npc1 = new NPC(g);
|
||||||
int y = 100;
|
spwNpc1 = false;
|
||||||
v++;
|
}
|
||||||
npc1.make(g,v,y);
|
if (spwNpc2){
|
||||||
|
NPC npc2 = new NPC(g);
|
||||||
System.out.println(v);
|
spwNpc2 = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean mouseDown(Event e, int x, int y){
|
public boolean mouseDown(Event e, int x, int y){
|
||||||
|
btnException = true;
|
||||||
if (startBtn.inside(x,y)){
|
if (startBtn.inside(x,y)){
|
||||||
start = true;
|
start = true;
|
||||||
repaint();
|
|
||||||
}
|
}
|
||||||
if (lBtn.inside(x,y)){
|
if (lBtn.inside(x,y)){
|
||||||
Px-=10;
|
Px-=10;
|
||||||
repaint();
|
|
||||||
}
|
}
|
||||||
if (rBtn.inside(x,y)){
|
if (rBtn.inside(x,y)){
|
||||||
Px+=10;
|
Px+=10;
|
||||||
repaint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btnException = false;
|
||||||
|
repaint();
|
||||||
System.out.println(x+" "+y);
|
System.out.println(x+" "+y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,9 @@ import project.Expo;
|
|||||||
import java.applet.Applet;
|
import java.applet.Applet;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public class NPC1 extends Applet {
|
public class NPC extends Thread {
|
||||||
public NPC1(Graphics g) {
|
public NPC(Graphics g) {
|
||||||
|
int x = Expo.random(100,400);
|
||||||
}
|
|
||||||
public static void make(Graphics g, int x, int y){
|
|
||||||
// int x = Expo.random(100,400);
|
|
||||||
Expo.setColor(g,colorsTemp.NPC1Body);
|
Expo.setColor(g,colorsTemp.NPC1Body);
|
||||||
Expo.fillRectangle(g, x, 110, x+35, 170);
|
Expo.fillRectangle(g, x, 110, x+35, 170);
|
||||||
Expo.setColor(g,colorsTemp.Tires);
|
Expo.setColor(g,colorsTemp.Tires);
|
||||||
@ -19,6 +16,17 @@ public class NPC1 extends Applet {
|
|||||||
Expo.fillRectangle(g, x+30, 118, x+40, 138);
|
Expo.fillRectangle(g, x+30, 118, x+40, 138);
|
||||||
Expo.fillRectangle(g, x+30, 145, x+40, 165);
|
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.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.setColor(g,colorsTemp.NPC1Body);
|
||||||
// Expo.fillRectangle(g, 100, 100, 135, 160);
|
// Expo.fillRectangle(g, 100, 100, 135, 160);
|
Loading…
x
Reference in New Issue
Block a user