init render
This commit is contained in:
parent
84b34e75b5
commit
58c30862a2
BIN
Render.class
Normal file
BIN
Render.class
Normal file
Binary file not shown.
11
Render.ctxt
Normal file
11
Render.ctxt
Normal file
@ -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
|
||||
32
Render.java
Normal file
32
Render.java
Normal file
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
game.class
BIN
game.class
Binary file not shown.
26
game.ctxt
26
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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user