helper functions

This commit is contained in:
hihoman23 2026-06-18 12:48:35 +02:00
parent 5bd087486b
commit e99ed3fa80
3 changed files with 53 additions and 9 deletions

Binary file not shown.

View File

@ -1,7 +1,21 @@
#BlueJ class context #BlueJ class context
comment0.target=game comment0.target=Game
comment0.text=\r\n\ Klasse\ game.\r\n\ \ \r\n\ @author\ \r\n
comment1.params= comment1.params=
comment1.target=game() comment1.target=Game()
comment1.text=---------------Konstruktor--- comment1.text=---------------Konstruktor---
numComments=2 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)
comment7.params=x\ y\ b\ h
comment7.target=void\ _ellipse(float,\ float,\ float,\ float)
comment8.params=x
comment8.target=float\ _random(float)
numComments=9

View File

@ -4,16 +4,46 @@
* *
* @author * @author
*/ */
public class game { import processing.core.PApplet;
public class Game extends PApplet{
/*---------------Attribute-----*/ /*---------------Attribute-----*/
int cellSize = 40;
/*---------------Konstruktor---*/ /*---------------Konstruktor---*/
public game() { public Game() {
String[] processingArgs = {"MySketch"};
PApplet.runSketch(processingArgs, this);
} }
/*---------------Methoden------*/ /*---------------Methoden------*/
public void settings() {
size(10 * cellSize, 10*cellSize);
}
public void _arc(float x, float y, float b, float h, float HALF_PI, float PI) {
arc(x, y, b, h, HALF_PI, PI);
}
public void _fill(int r, int g, int b) {
fill(r, g, b);
}
public void _fill(int b) {
fill(b);
}
public void _rect(float x, float y, float b, float h) {
rect(x, y, b, h);
}
public void _ellipse(float x, float y, float b, float h) {
ellipse(x, y, b, h);
}
public float _random(float x) {
return random(x);
}
} }