package maze;
import java.awt.*;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import maze.Player;
public class Level2 extends JPanel {
private Image greenButton;
private Image end;
private Image wallHalf;
private Image wallHalfSide;
boolean button1 = true;
boolean button2 = true;
boolean button3 = true;
public Level2(){
ImageIcon iigB = new ImageIcon(this.getClass().getResource("greenButton.png"));
greenButton = iigB.getImage();
ImageIcon iie = new ImageIcon(this.getClass().getResource("finishHole.png"));
end = iie.getImage();
ImageIcon iiwh = new ImageIcon(this.getClass().getResource("wallhalf.png"));
wallHalf = iiwh.getImage();
ImageIcon iiwhs = new ImageIcon(this.getClass().getResource("wallhalfside.png"));
wallHalfSide = iiwhs.getImage();
}
public Rectangle getBounds8(){
return new Rectangle(540, 510, 30, 30);
}
public Rectangle getBounds7(){
return new Rectangle(540, 30, 210, 330);
}
//green button in room 3
public Rectangle getBounds6(){
return new Rectangle(60, 60, 30, 30);
}
public Rectangle getBounds5(){
return new Rectangle(-30, 240, 30, 270);
}
//green button in room2
public Rectangle getBounds4() {
return new Rectangle(390, 60, 30, 30);
}
//green button in room1
public Rectangle getBounds3() {
return new Rectangle(180, 510, 30, 30);
}
public Rectangle getBounds2() {
return new Rectangle(0, 330, 270, 30);
}
public Rectangle getBounds1() {
return new Rectangle(210, 360, 30, 270);
}
public Rectangle getBounds() {
return new Rectangle(210, 0, 30, 270);
}
public void paintComponent(Graphics g)
{
super.paintComponents(g);
Graphics2D g2d = ( Graphics2D )g;
g2d.drawImage(greenButton, 60, 60, this);
g2d.drawImage(greenButton, 180, 510, this);
g2d.drawImage(greenButton, 390, 60, this);
g2d.drawImage(end, 540, 510, this);
g2d.drawImage(wallHalf, 210, 0, this);
g2d.drawImage(wallHalf, 210, 360, this);
if(button1){
g2d.drawImage(wallHalfSide, 0, 330, this);
}
if(button2){
g2d.drawImage(wallHalfSide, -30, 240, this);
}
if(button3){
g2d.drawImage(wallHalfSide, 210, 330, this);
g2d.drawImage(wallHalfSide, 450, 330, this);
}
}
}