Compare commits
2 Commits
a542138873
...
a5e0b2d32a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5e0b2d32a | ||
|
|
5f22eb4565 |
BIN
Render.class
BIN
Render.class
Binary file not shown.
@ -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
|
||||
|
||||
15
Render.java
15
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){
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user