diff --git a/Render.class b/Render.class new file mode 100644 index 0000000..f965aa4 Binary files /dev/null and b/Render.class differ diff --git a/Render.ctxt b/Render.ctxt new file mode 100644 index 0000000..90d9620 --- /dev/null +++ b/Render.ctxt @@ -0,0 +1,11 @@ +#BlueJ class context +comment0.target=Render +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) +comment3.params=x\ y\ open +comment3.target=void\ drawPacman(int,\ int,\ boolean) +numComments=4 diff --git a/Render.java b/Render.java new file mode 100644 index 0000000..b13302e --- /dev/null +++ b/Render.java @@ -0,0 +1,32 @@ + +/** + * 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){ + + + } + public void drawPacman(int x, int y, boolean open){ + game.fill(255,255,0); + if(open){ + + }else{ + game.circle(x, y, game.cellSize*0.8f); + } + + } +} diff --git a/game.class b/game.class index 67a818e..81078d2 100644 Binary files a/game.class and b/game.class differ diff --git a/game.ctxt b/game.ctxt index fb84411..c59c4fe 100644 --- a/game.ctxt +++ b/game.ctxt @@ -6,16 +6,18 @@ comment1.text=---------------Konstruktor--- comment2.params= comment2.target=void\ settings() comment2.text=---------------Methoden------ -comment3.params=x\ y\ b\ h\ HALF_PI\ PI -comment3.target=void\ _arc(float,\ float,\ float,\ float,\ float,\ float) -comment4.params=r\ g\ b -comment4.target=void\ _fill(int,\ int,\ int) -comment5.params=b -comment5.target=void\ _fill(int) -comment6.params=x\ y\ b\ h -comment6.target=void\ _rect(float,\ float,\ float,\ float) +comment3.params= +comment3.target=void\ draw() +comment4.params=x\ y\ b\ h\ HALF_PI\ PI +comment4.target=void\ _arc(float,\ float,\ float,\ float,\ float,\ float) +comment5.params=r\ g\ b +comment5.target=void\ _fill(int,\ int,\ int) +comment6.params=b +comment6.target=void\ _fill(int) comment7.params=x\ y\ b\ h -comment7.target=void\ _ellipse(float,\ float,\ float,\ float) -comment8.params=x -comment8.target=float\ _random(float) -numComments=9 +comment7.target=void\ _rect(float,\ float,\ float,\ float) +comment8.params=x\ y\ b\ h +comment8.target=void\ _ellipse(float,\ float,\ float,\ float) +comment9.params=x +comment9.target=float\ _random(float) +numComments=10 diff --git a/game.java b/game.java index 06638d4..f2a9638 100644 --- a/game.java +++ b/game.java @@ -8,11 +8,12 @@ import processing.core.PApplet; public class Game extends PApplet{ /*---------------Attribute-----*/ int cellSize = 40; - + Render render; /*---------------Konstruktor---*/ public Game() { String[] processingArgs = {"MySketch"}; PApplet.runSketch(processingArgs, this); + render = new Render(this); } /*---------------Methoden------*/ @@ -21,7 +22,10 @@ public class Game extends PApplet{ size(10 * cellSize, 10*cellSize); } - + public void draw (){ + background(0); + render.drawPacman(100,100, false); + } public void _arc(float x, float y, float b, float h, float HALF_PI, float PI) { arc(x, y, b, h, HALF_PI, PI); diff --git a/package.bluej b/package.bluej index 34a3f7a..bdd5161 100644 --- a/package.bluej +++ b/package.bluej @@ -1,20 +1,23 @@ #BlueJ package file -editor.fx.0.height=0 -editor.fx.0.width=0 -editor.fx.0.x=0 -editor.fx.0.y=0 +dependency1.from=render +dependency1.to=Game +dependency1.type=UsesDependency +editor.fx.0.height=739 +editor.fx.0.width=816 +editor.fx.0.x=552 +editor.fx.0.y=98 objectbench.height=93 objectbench.width=760 package.divider.horizontal=0.6 package.divider.vertical=0.8 package.editor.height=393 package.editor.width=649 -package.editor.x=208 -package.editor.y=208 +package.editor.x=41 +package.editor.y=220 package.frame.height=600 package.frame.width=800 -package.numDependencies=0 -package.numTargets=0 +package.numDependencies=1 +package.numTargets=2 package.showExtends=true package.showUses=true project.charset=UTF-8 @@ -23,3 +26,17 @@ readme.name=@README readme.width=49 readme.x=10 readme.y=10 +target1.height=70 +target1.name=Game +target1.showInterface=false +target1.type=ClassTarget +target1.width=120 +target1.x=290 +target1.y=40 +target2.height=70 +target2.name=render +target2.showInterface=false +target2.type=ClassTarget +target2.width=120 +target2.x=100 +target2.y=200