From 7d72e7bb54810b40e631f6a118e47b3432dda6ae Mon Sep 17 00:00:00 2001 From: qsnow1845 Date: Wed, 22 May 2019 15:08:40 -0500 Subject: [PATCH] pushed test NPC locomotion Signed-off-by: qsnow1845 --- src/project/Main.java | 5 +++++ src/project/Sprites/NPC1.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/project/Main.java b/src/project/Main.java index 743a69f..6e95435 100644 --- a/src/project/Main.java +++ b/src/project/Main.java @@ -16,6 +16,7 @@ public class Main extends Applet { if (start){ Draw.begin(g); playerLocomotion(g); + npcLocomotion(g); } else{ Draw.startScreen(g); @@ -31,6 +32,10 @@ public class Main extends Applet { } } + public static void npcLocomotion(Graphics g){ + project.Sprites.NPC1 npc1 = new project.Sprites.NPC1(g); + } + public boolean mouseDown(Event e, int x, int y){ if (startBtn.inside(x,y)){ diff --git a/src/project/Sprites/NPC1.java b/src/project/Sprites/NPC1.java index 929d332..5e79f77 100644 --- a/src/project/Sprites/NPC1.java +++ b/src/project/Sprites/NPC1.java @@ -6,7 +6,8 @@ import java.applet.Applet; import java.awt.*; public class NPC1 extends Applet { - public static void make(Graphics g, int x) { + public NPC1(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);