expoCarGame/src/project/Main.java

46 lines
1.1 KiB
Java
Raw Normal View History

package project;
2019-05-17 15:08:45 -05:00
import java.applet.Applet;
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(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;
2019-05-17 15:08:45 -05:00
}
public static void test(Graphics g){
2019-05-21 15:26:43 -05:00
project.Sprites.NPC1.NPC1(g,Expo.random(100,400));
}
2019-05-17 15:01:03 -05:00
}