diff --git a/Render.class b/Render.class index f965aa4..c8c8d66 100644 Binary files a/Render.class and b/Render.class differ diff --git a/Render.ctxt b/Render.ctxt index 90d9620..5e7f205 100644 --- a/Render.ctxt +++ b/Render.ctxt @@ -4,8 +4,8 @@ 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 -comment2.target=void\ drawGhost(int,\ int,\ int,\ int,\ int) +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 diff --git a/Render.java b/Render.java index b13302e..3d086c3 100644 --- a/Render.java +++ b/Render.java @@ -16,16 +16,25 @@ public class Render { } - public void drawGhost(int x, int y, int r, int g, int b){ - + public void drawGhost(int x, int y, int r, int g, int b, boolean visible){ + game.fill(255); + if(visible){ + game.circle(x,y,game.cellSize*0.8f); + game.rect(x-game.cellSize*0.4f, y-game.cellSize*0.4f, game.cellSize*0.8f,game.cellSize*0.8f); + } } public void drawPacman(int x, int y, boolean open){ game.fill(255,255,0); + if(open){ - + game.arc(x,y,game.cellSize*0.8f,game.cellSize*0.8f, game.radians(45),game.radians(315)); + game.fill(0); + game.circle(x-5,y-5,game.cellSize*0.15f); }else{ game.circle(x, y, game.cellSize*0.8f); + game.fill(0); + game.circle(x-5,y-5,game.cellSize*0.15f); } }