42 lines
1012 B
Java
42 lines
1012 B
Java
|
|
/**
|
|
* Klasse render.
|
|
*
|
|
* @author
|
|
*/
|
|
public class Render {
|
|
/*---------------Attribute-----*/
|
|
Game game;
|
|
|
|
|
|
/*---------------Konstruktor---*/
|
|
public Render(Game game) {
|
|
this.game = game;
|
|
|
|
}
|
|
|
|
|
|
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);
|
|
}
|
|
|
|
}
|
|
}
|