From e99ed3fa802d6d1d2f2cb1bde089e7e4ca1ccb4d Mon Sep 17 00:00:00 2001 From: hihoman23 <78002940+hihoman23@users.noreply.github.com> Date: Thu, 18 Jun 2026 12:48:35 +0200 Subject: [PATCH] helper functions --- game.class | Bin 241 -> 1429 bytes game.ctxt | 22 ++++++++++++++++++---- game.java | 40 +++++++++++++++++++++++++++++++++++----- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/game.class b/game.class index b6ae60ab06476b08450cc44dba35e4ab9d59a464..67a818ee54cc09fd6b0a48582eac5452c42264d2 100644 GIT binary patch literal 1429 zcmbtSYflqF6g@-V+ojaC8?9VMIbuR79Z)_&4h-eufuSgd5EF>M z)!*ycx=yrm$0BGLan?OKF26H6)tV$vs2IeMK*Tz1IJ*Mb^vhCjXRdUPv|MIKp_~yF zNnE6swk;r#E*71{n2K>sP`7SXNs}(vKPPud#T2I5^v0~$IipNEnaeVhVkYgv%&EA7 zd2U!nm3D+|9H%y;LX)Ww$2VJTL&{lHaTQC1wDiVa^FRU>G6jA%ntSwTpky|Tr-ui- zhV@L}t#c<)YF737j&7Oqzq{%0)XX+PO48t*K>j*-uf))@Ki=pG|EdJOA~q;>c4z*X^_HL@zIjh{@MOrCTx*(+g+ zZcW<~G^f;)5Jlb{Fp7taq=YCXsFWZ{QZC6lGcp&{#=Ds5#ZOV(>|du4^zef=mOO?Zul%1Zf*@#i{i06wflnvrO?UQ{Y%8@aTNDbT8Wi*%tqc?J<_z k*;YNDQe7;38JZ8CZB2SQ*$D83eKt%M$f-67$ma{gbj%lS>#G z*laTMGE3|j8JIOR!`K-(7#Ud76LV81S1?+Zf*96}3|ztarA5i9Zkai$j0~J0K|PQ; z42lfwK;uDx5eR`607*_D<>SU|`kS&cL`4D8R(P1tdXkVPN24U}4~8;0Ci8fg~$X PgcnFNGVlROCI)^0DIFce diff --git a/game.ctxt b/game.ctxt index 8d3aebb..fb84411 100644 --- a/game.ctxt +++ b/game.ctxt @@ -1,7 +1,21 @@ #BlueJ class context -comment0.target=game -comment0.text=\r\n\ Klasse\ game.\r\n\ \ \r\n\ @author\ \r\n +comment0.target=Game comment1.params= -comment1.target=game() +comment1.target=Game() 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 diff --git a/game.java b/game.java index d2d52ce..06638d4 100644 --- a/game.java +++ b/game.java @@ -4,16 +4,46 @@ * * @author */ -public class game { +import processing.core.PApplet; +public class Game extends PApplet{ /*---------------Attribute-----*/ - - + int cellSize = 40; + /*---------------Konstruktor---*/ - public game() { + public Game() { + String[] processingArgs = {"MySketch"}; + PApplet.runSketch(processingArgs, this); } /*---------------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); + } }