Compare commits

...

2 Commits

Author SHA1 Message Date
Vector
a5e0b2d32a Merge branch 'main' of https://git.goegy.online/m.meiringer/Pacman 2026-06-25 12:37:10 +02:00
Vector
5f22eb4565 render pacman 2026-06-25 12:36:58 +02:00
3 changed files with 14 additions and 5 deletions

Binary file not shown.

View File

@ -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

View File

@ -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);
}
}