From d864db5aadf5a8b5a1db9bc51798afece0d6b4ab Mon Sep 17 00:00:00 2001 From: hihoman23 <78002940+hihoman23@users.noreply.github.com> Date: Thu, 2 Jul 2026 12:51:00 +0200 Subject: [PATCH] fixus --- Ghost.class | Bin 0 -> 393 bytes Ghost.ctxt | 7 +++++++ Ghost.java | 25 +++++++++++++++++++++++++ Pacman.class | Bin 1160 -> 1158 bytes Pacman.java | 5 +++-- package.bluej | 42 ++++++++++++++++++++++++++---------------- 6 files changed, 61 insertions(+), 18 deletions(-) create mode 100644 Ghost.class create mode 100644 Ghost.ctxt create mode 100644 Ghost.java diff --git a/Ghost.class b/Ghost.class new file mode 100644 index 0000000000000000000000000000000000000000..619e243ea394033fff1985b4f9028cabe0ab1cd9 GIT binary patch literal 393 zcmXX?O;5r=6r3%E+FGSl!0&@MsEPalKQ1N^lSU7k-WP131ZYwU(Vyjkn0W99_@j*T z77sfwGw;pY+5P$b`UY@|a}O3O4s0J))D(iLUhCdWFUGy6;WQnU3bmVTk(GA}l};qE=VKSXLUl07mz+^=JP*>`_feOQdKcF45#m6>9_x9^Rq=rJTEP|GFO2ARwrV%w z+K;6zAFQyI|Irr}J^pJ)-=R1>kQ(WWwb(x#N_~!r31qyFCv8 literal 0 HcmV?d00001 diff --git a/Ghost.ctxt b/Ghost.ctxt new file mode 100644 index 0000000..d0101f6 --- /dev/null +++ b/Ghost.ctxt @@ -0,0 +1,7 @@ +#BlueJ class context +comment0.target=Ghost +comment0.text=\r\n\ Klasse\ Ghost.\r\n\ \ \r\n\ @author\ \r\n +comment1.params=game +comment1.target=Ghost(Game) +comment1.text=---------------Konstruktor--- +numComments=2 diff --git a/Ghost.java b/Ghost.java new file mode 100644 index 0000000..5bac720 --- /dev/null +++ b/Ghost.java @@ -0,0 +1,25 @@ +import java.awt.Frame; + +/** + * Klasse Ghost. + * + * @author + */ +public class Ghost { + /*---------------Attribute-----*/ + int x; + int y; + Game game; + int gameFrame; + + /*---------------Konstruktor---*/ + public Ghost(Game game) { + x = 20; y = 20; + this.game = game; + } + + /*---------------Methoden------*/ + + + +} diff --git a/Pacman.class b/Pacman.class index fa7dcec434960748bb7532ece975f543d3b757ba..39ae356e98c7c30f97f2febf5889316fd6100bf9 100644 GIT binary patch delta 104 zcmV-u0GI!W35E%Io z0CoT)0IC2a0IvWg0JH!o0MY;{0Pp}RlcobT3=04S{QxBa0U8<_J(KAJQwc2q3IHwu KEdVc*MFc}YgBN80 delta 106 zcmZqU?BLvx!o=7zIhDy{vLdtGI@$kG$$`(Hs#}GVExOW%E%~XA@!Rfdh&DTU``zdE(Tp7 K)SK+g;tT+=0U2fh diff --git a/Pacman.java b/Pacman.java index 791997f..907f13c 100644 --- a/Pacman.java +++ b/Pacman.java @@ -26,18 +26,19 @@ public class Pacman { if (keyCode == game.LEFT) { x -= game.cellSize; } - x = (x + (11 * game.cellSize)) % (11 * game.cellSize); if (keyCode == game.UP) { y -= game.cellSize; } if (keyCode == game.DOWN) { y += game.cellSize; } - y = (y + (11 * game.cellSize)) % (11 * game.cellSize); if (!game.wantMove(oldX/game.cellSize, oldY/game.cellSize, x/game.cellSize, y/game.cellSize)) { x = oldX; y = oldY; } + + x = (x + (11 * game.cellSize)) % (11 * game.cellSize); + y = (y + (11 * game.cellSize)) % (11 * game.cellSize); } public void draw() { diff --git a/package.bluej b/package.bluej index 9f48ba7..232ae34 100644 --- a/package.bluej +++ b/package.bluej @@ -8,25 +8,28 @@ dependency2.type=UsesDependency dependency3.from=Game dependency3.to=Pacman dependency3.type=UsesDependency -dependency4.from=Render +dependency4.from=Ghost dependency4.to=Game dependency4.type=UsesDependency -editor.fx.0.height=0 -editor.fx.0.width=0 -editor.fx.0.x=0 -editor.fx.0.y=0 +dependency5.from=Render +dependency5.to=Game +dependency5.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=20 -package.editor.y=248 +package.editor.x=374 +package.editor.y=268 package.frame.height=600 package.frame.width=800 -package.numDependencies=4 -package.numTargets=3 +package.numDependencies=5 +package.numTargets=4 package.showExtends=true package.showUses=true project.charset=UTF-8 @@ -40,19 +43,26 @@ target1.name=Pacman target1.showInterface=false target1.type=ClassTarget target1.width=120 -target1.x=70 -target1.y=10 +target1.x=370 +target1.y=20 target2.height=70 target2.name=Game target2.showInterface=false target2.type=ClassTarget target2.width=120 -target2.x=290 -target2.y=40 +target2.x=10 +target2.y=90 target3.height=70 -target3.name=Render +target3.name=Ghost target3.showInterface=false target3.type=ClassTarget target3.width=120 -target3.x=80 -target3.y=200 +target3.x=430 +target3.y=210 +target4.height=70 +target4.name=Render +target4.showInterface=false +target4.type=ClassTarget +target4.width=120 +target4.x=80 +target4.y=200