Merge kenneth dev

This commit is contained in:
Yorick
2015-04-08 13:11:22 +02:00
17 changed files with 122 additions and 55 deletions
+23 -11
View File
@@ -45,7 +45,7 @@ import Objects.Wall;
public class Panel extends JPanel implements ActionListener
{
BufferedImage grass, sand;
BufferedImage grass, grass2, sand, sand2, stone;
BufferedImage background;
BufferedImage podiumImage, toiletImage, entranceImage, pathImage, wallImage, foodImage, waypointImage;
@@ -61,8 +61,8 @@ public class Panel extends JPanel implements ActionListener
private DrawObject selectedObject;
private String clickedOption = "drag";
private Path currentPath;
private int width = 1920;
private int height = 1080;
private static int width = 1920;
private static int height = 1080;
Point2D cameraPoint = new Point2D.Double(getWidth() / 2, getHeight() / 2);
float cameraScale = 1;
@@ -108,7 +108,10 @@ public class Panel extends JPanel implements ActionListener
try
{
grass = ImageIO.read(new File("images/grass.jpg"));
grass2 = ImageIO.read(new File("images/grass2.png"));
sand = ImageIO.read(new File("images/sand.jpg"));
sand2 = ImageIO.read(new File("images/sand2.jpg"));
stone = ImageIO.read(new File("images/stone.jpg"));
podiumImage = ImageIO.read(new File("images/stageIcon.png"));
toiletImage = ImageIO.read(new File("images/wcIcon.png"));
entranceImage = ImageIO.read(new File("images/entranceIcon.png"));
@@ -557,12 +560,12 @@ public class Panel extends JPanel implements ActionListener
this.agenda = agenda;
}
public int getFieldWidth()
public static int getFieldWidth()
{
return width;
}
public int getFieldHeight()
public static int getFieldHeight()
{
return height;
}
@@ -612,12 +615,21 @@ public class Panel extends JPanel implements ActionListener
cameraScale = 1;
switch (terrainIndex)
{
case 0:
background = grass;
break;
case 1:
background = sand;
break;
case 0:
background = grass;
break;
case 1:
background = grass2;
break;
case 2:
background = sand;
break;
case 3:
background = sand2;
break;
case 4:
background = stone;
break;
}
repaint();
}