Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
void setup() {
  //size of window
  size(400, 400);
}

void draw() {
  //Background 
  background(180, 180, 180);

  //Wall
  fill(0, 0, 180);
  rect(0, 0, 400, 325);

  //Game
  //Game Screen
  fill(100, 100, 255);
  rect(120, 140, 160, 130);

  //Game Grass
  fill(100, 255, 100);
  rect(120, 240, 160, 30);

  //Left Health Bar
  fill(255, 0, 0);
  rect(130, 150, 60, 10);

  //Right Health Bar
  fill(255, 0, 0);
  rect(210, 150, 60, 10);

  //Left Player
  //Left Player Head
  fill(0);
  rect(mouseX, mouseY - 120, 20, 20);

  //Left Player Torso. (Moving Mouse Also Moves The Left Character)
  stroke(0);
  line(mouseX + 10, mouseY - 100, mouseX + 10, mouseY -70);

  //Left Player Left Leg
  stroke(0);
  line(mouseX + 10, mouseY - 70, mouseX - 10, mouseY - 40);

  //Left Player Right Leg 
  stroke(0);
  line(mouseX + 10, mouseY - 70, mouseX + 30, mouseY - 40);

  // Left Player right Wrist
  stroke(0);
  line(mouseX + 30, mouseY - 90, mouseX + 30, mouseY - 80);

  //Left Player Right Arm
  stroke(0);
  line(mouseX + 10, mouseY - 90, mouseX + 30, mouseY - 90);

  //Left Player Right Glove
  fill(200, 0, 0);
  rect(mouseX + 25, mouseY - 80, 10, 10);

  //Left Player Left Arm
  stroke(0);
  line(mouseX + 10, mouseY - 90, mouseX - 10, mouseY - 90);

  // Left Player Left Wrist
  stroke(0);
  line(mouseX - 10, mouseY - 90, mouseX - 10, mouseY - 80);

  // Left Player Left Glove
  fill(200, 0, 0);
  rect(mouseX - 15, mouseY - 80, 10, 10);

  //Room 
  //Second Layer Wall (For game movement to overlap charcter so it look like hes in the game) 
  //Left side Wall
  noStroke(); 
  fill(0, 0, 180);
  rect(0, 0, 80, 325);

  //Top Side Wall
  fill(0, 0, 180);
  rect(0, 0, 400, 40);

  //Right Side wall
  fill(0, 0, 180);
  rect(320, 0, 80, 325);

  //Floor Seocnd Layer
  fill(180, 180, 180);
  rect(0, 325, 400, 80);

  //Outlit 
  fill(255);
  rect(30, 290, 20, 30);

  //Arcade
  noStroke();
  //Arcade Cab Main Body Top
  fill(#F08411);
  rect(80, 80, 240, 60);

  //Arcade Cab Main Body Left
  fill(#F08411);
  rect(80, 80, 40, 320);

  //Arcade Cab Main Body Bot
  fill(#F08411);
  rect(80, 270, 240, 280);

  //Arcade Cab Main Body Right 
  fill(#F08411);
  rect(280, 80, 40, 320);

  //Front Of Controller Desk
  fill(#DB2716);
  rect(70, 340, 260, 20);

  //Left Corner of Controller 
  fill(#FA4F3F);
  triangle(80, 325, 70, 340, 80, 340);

  //Right Corner of Controller
  fill(#FA4F3F);
  triangle(320, 325, 330, 340, 320, 340);

  //Top Of Controller Desk
  fill(#FA4F3F);
  rect(80, 325, 240, 15);

  //Top Slope
  fill(#FC741F);
  rect(80, 80, 240, 30);

  //Left Corner Slope
  fill(#FC741F);
  triangle(60, 80, 80, 80, 80, 110);

  //Right Corner Slope
  fill(#FC741F);
  triangle(320, 80, 320, 110, 340, 80);

  //Arcade Very Top
  fill(#F06711);
  rect(60, 40, 280, 40);

  //Static Right Player 
  //Right Player
  ellipseMode(CENTER);
  //Right Player Head
  fill(0);
  ellipse(240, 190, 20, 20);

  //Right player Torso
  stroke(0);
  line(240, 200, 240, 230);

  //Right PLayer Left Leg
  stroke(0);
  line(240, 230, 220, 260);

  //Right PLayer Right Leg
  stroke(0);
  line(240, 230, 260, 260);

  //Right Player Left Leg
  stroke(0);
  line(240, 210, 220, 210);

  //Right Player Left Glove
  fill(50, 200, 50);
  rect(220, 204, 10, 10);

  //Right Player Right Arm
  stroke(0);
  line(240, 210, 260, 210);

  //Right Player Wrist
  stroke(0);
  line(260, 210, 260, 220);

  //Right Player Right Glove
  fill(50, 200, 50);
  rect(255, 220, 10, 10);

  //Game Title
  //Letter G Top
  stroke(0);
  line(150, 50, 170, 50);

  //Letter G Left
  stroke(0);
  line(150, 50, 150, 70);

  //Letter G Bot
  stroke(0);
  line(150, 70, 170, 70);

  //Letter G Right
  stroke(0);
  line(170, 70, 170, 60);

  //Letter G Center
  stroke(0);
  line(170, 60, 160, 60);

  //Letter A Top
  stroke(0);
  line(180, 50, 200, 50);

  //Letter A Left
  stroke(0);
  line(180, 50, 180, 70);

  //Letter A Mid
  stroke(0);
  line(180, 60, 200, 60);

  //Letter A Right 
  stroke(0);
  line(200, 70, 200, 50);

  //Letter M Left
  stroke(0);
  line(210, 50, 210, 70);

  //Letter M Mid
  stroke(0);
  line(220, 50, 220, 70);

  //Letter M Right 
  stroke(0);
  line(230, 50, 230, 70);

  //Letter M Top
  stroke(0);
  line(210, 50, 230, 50);

  //Letter E Top
  stroke(0);
  line(240, 50, 260, 50);

  //Letter E Mid
  stroke(0);
  line(240, 60, 260, 60);

  // Letter E Bot
  stroke(0);
  line(240, 70, 260, 70);

  //Letter E Left
  stroke(0);
  line(240, 50, 240, 70);

  //Outlit
  //Outlit 1 Left Hole
  fill(0);
  rect(32, 295, 3, 5);

  //Outlit 1 Right Hole
  fill(0);
  rect(44, 295, 3, 5);

  //Outlit 1 Mid Hole
  fill(0);
  rect(37, 305, 5, 5);

  //Arcade Controller 
  ellipseMode(CENTER);

  noStroke();

  //Stick Dust Wash
  fill(#8E7572);
  ellipse(150, 332, 28, 10);

  //Stick Shaft Move Mouse To move Stick
  fill(0);
  quad(148, 332, 152, 332, mouseX, mouseY, mouseX - 2, mouseY - 2);

  noStroke();

  ellipseMode(CENTER);

  //Ball Top moves With Stick
  fill(200, 0, 0);
  ellipse(mouseX, mouseY, 20, 20);

  //Ball Top Glair Moves With Stick
  fill(#F26558);
  ellipse(mouseX - 2, mouseY - 5, 10, 10);

  //Button Bot Left
  fill(80);
  ellipse(200, 335, 10, 5);

  //Button Top Left
  fill(80);
  ellipse(200, 329, 10, 5);

  //Button 2nd Bot 
  fill(80);
  ellipse(212, 335, 10, 5);

  //Button 2nd Top
  fill(80);
  ellipse(212, 329, 10, 5);

  //Button 3rd Bot
  fill(80);
  ellipse(224, 335, 10, 5);

  //Button 3rd Top
  fill(80);
  ellipse(224, 329, 10, 5);

  //Button 4th Bot
  fill(80);
  ellipse(236, 335, 10, 5);

  //Button 4th Top
  fill(80);
  ellipse(236, 329, 10, 5);
}