package Main; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; import org.newdawn.slick.SlickException; import org.newdawn.slick.geom.Rectangle; public class Panel { Image panel; int i ; int xPos,xSize,yPos,xSpd; //Level Modelierungen int[] yPos_level1= {0,12,12,11,11,10,10, 9, 9,-1,-1, -1,-1, 9, 9, 9,10,10,11,11,12, 12,-1,-1,11,11,-1,-1,10,10,-1, -1, 9, 9,-1,-1,-1, 9, 9,-1,-1, -1,-1, 9, 9, 9,-1,-1,-1,-1,-1, 11,11,-1,-1,10,10,12,12, 7, 7, 7,-1,-1,-1,-1,-1, 8, 8, 7, 7, -1,-1,-1,-1,-1,-1,11,11,-1,-1, -1,-1,-1,12,12,10,10,-1,-1,-1, -1,-1,11,11,12,12,12,12,12}; int[] yPos_level2= {0, 9, 9, 9,-1,-1, 8,10, 5,12, 5, 12, 9, 9, 9,-1, 5,12,-1,-1, 5, -1,12,-1,-1,-1,-1,11,11,11,-1, -1,-1,-1,10,10,10,-1,-1,-1,-1, 9, 9, 9,-1,12,12,12,-1, 8, 8, 8,-1,12,12,-1, 7, 7, 7,12,12, 12,12, 6, 6, 6,-1,12,12,-1, 5, 5, 5,-1,-1,-1,-1,-1,-1,-1,12, 12,12,12,12,12,-1,-1,-1,10,10, 10,-1,-1,-1, 9, 9,10,10,10}; int[] yPos_level3= {0, 7, 7, 7,11,11,11,-1,-1, 8, 8, 8,-1,-1,-1, 5, 5, 5,-1,-1, 8, -1,-1,-1,-1,12,-1, 6,-1,-1, 9, -1, 5, 5, 6, 6, 8, 8, 8, 9, 9, -1,-1,-1, 6,12,-1, 9,-1,-1, 5, 5, 5, 9, 7, 6,12,-1,-1,-1,11, 6,12,12, 9, 5, 5,-1,-1,-1,-1, -1,-1,-1, 9, 9, 9, 9,-1,-1,-1, -1,12,12,-1, 6,12, 5,10,-1,-1, -1, 5, 7, 7, 8, 8, 8, 8, 8}; int[] yPos_level4= {0,12,12,11,11,10,10,11,11,12,12, 11,12,12,11,11,12,12,10,10,19, 19,19,10,11,11,12,12,12,12,12, 12,11,11,11,10,10,10, 8,11, 8, 11,10,10,10, 9, 9, 8, 4,11, 4, 11, 4,11, 8, 8, 8, 4,11, 4,11, 4,12, 8, 8, 9, 9, 9,10,10,10, 11,11,11,12,12,12,12,12,12,12, 12,12,12,12,12,12,12,12,12,12, 12,12,12,12,12,12,12,12,12}; int[] yPos_finalLevel= {0,12, 5,-1, 9,-1,-1,12, 5,-1,-1, 9,-1, 5,12}; State state; Rectangle[] collisionarea;// Kollisionsvierecke für die Roboter-Panel Kollisionen int currentLevel; public void init(GameContainer gc, State state,int currentLevel) throws SlickException { // TODO Auto-generated method stub this.state = state; this.currentLevel = currentLevel; panel = new Image ("Main/panel.png"); //initialwerte xSize = 50;//breite eines Panels yPos = 40;// höhe eines Panels xPos = 350;//Initial Position des ersten Panels xSpd = 0; //initiierung der einzelnen Kollisionsvierecke der jeweiligen Levels switch(currentLevel){ case 1: collisionarea = new Rectangle[yPos_level1.length]; for(int i = 1; i