diff --git a/Render.class b/Render.class index 88a12ff..39fb80e 100644 Binary files a/Render.class and b/Render.class differ diff --git a/Render.ctxt b/Render.ctxt index 5e7f205..38b9b27 100644 --- a/Render.ctxt +++ b/Render.ctxt @@ -4,8 +4,10 @@ comment0.text=\r\n\ Klasse\ render.\r\n\ \ \r\n\ @author\ \r\n comment1.params=game comment1.target=Render(Game) comment1.text=---------------Konstruktor--- -comment2.params=x\ y\ r\ g\ b\ visible -comment2.target=void\ drawGhost(int,\ int,\ int,\ int,\ int,\ boolean) -comment3.params=x\ y\ open -comment3.target=void\ drawPacman(int,\ int,\ boolean) -numComments=4 +comment2.params=wall +comment2.target=void\ drawWall(int[]) +comment3.params=x\ y\ r\ g\ b\ visible +comment3.target=void\ drawGhost(int,\ int,\ int,\ int,\ int,\ boolean) +comment4.params=x\ y\ open +comment4.target=void\ drawPacman(int,\ int,\ boolean) +numComments=5 diff --git a/Render.java b/Render.java index 7d4b04f..ab524bb 100644 --- a/Render.java +++ b/Render.java @@ -15,7 +15,19 @@ public class Render { } - + public void drawWall(int [] wall){ + if(wall[0] == wall[2]){ + game.strokeWeight(4); + game.stroke(255,255,0); + game.line(wall[0]*game.cellSize,wall[3]*game.cellSize,wall[0]*game.cellSize+game.cellSize ,wall[3]*game.cellSize ); + } + else + { + game.strokeWeight(4); + game.stroke(255,255,0); + game.line(wall[0]*game.cellSize+game.cellSize,wall[1]*game.cellSize,wall[3]*game.cellSize ,wall[3]*game.cellSize+game.cellSize); + } + } public void drawGhost(int x, int y, int r, int g, int b, boolean visible){ game.fill(r,g,b); game.strokeWeight(0); @@ -43,7 +55,7 @@ public class Render { } public void drawPacman(int x, int y, boolean open){ game.fill(255,255,0); - + game.strokeWeight(0); if(open){ game.arc(x,y,game.cellSize*0.8f,game.cellSize*0.8f, game.radians(45),game.radians(315)); game.fill(0); diff --git a/game.class b/game.class index 7298b41..5911f7b 100644 Binary files a/game.class and b/game.class differ diff --git a/game.java b/game.java index 69741b3..21eadea 100644 --- a/game.java +++ b/game.java @@ -25,13 +25,16 @@ public class Game extends PApplet{ /*---------------Methoden------*/ public void settings() { - size(10 * cellSize, 10 * cellSize); + size(11 * cellSize, 11 * cellSize); } public void draw() { background(0); pacman.draw(); + for (int i = 0; i < wall.length; i++) { + render.drawWall(wall[i]); + } } public void keyPressed() { @@ -39,7 +42,6 @@ public class Game extends PApplet{ } public boolean wantMove(int ox, int oy, int nx, int ny) { - System.out.println(","+ox+","+ oy+","+ nx+","+ ny); if (ox == nx && oy > ny) { int a = oy; oy = ny; @@ -60,8 +62,10 @@ public class Game extends PApplet{ public void populateWalls(){ wall = new int[][]{ - {0, 0, 0, 1}, - {0, 1, 1, 1}, + {0, 4, 0, 5}, + {0, 5, 0, 6}, + {10,4,10,5}, + {10,5,10,6}, }; } }