From eb3bce08f588e2a54ac05f1cc3743e7d70b08785 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Jun 2020 15:37:07 +0200 Subject: [PATCH] perf fix --- bin/.gitignore | 13 ++++++++++ bin/BigPoint.class | Bin 462 -> 462 bytes bin/Brick.class | Bin 450 -> 450 bytes bin/Game.class | Bin 9635 -> 9481 bytes bin/Ghost.class | Bin 2792 -> 2792 bytes bin/Hintergrund.class | Bin 394 -> 394 bytes bin/Lives.class | Bin 336 -> 336 bytes bin/Main.class | Bin 1327 -> 1327 bytes bin/Map.class | Bin 2892 -> 2892 bytes bin/MapMenu.class | Bin 3039 -> 3015 bytes bin/Point.class | Bin 450 -> 450 bytes bin/Portal.class | Bin 454 -> 454 bytes src/Game.java | 54 +++++++++++++++++++----------------------- 13 files changed, 38 insertions(+), 29 deletions(-) diff --git a/bin/.gitignore b/bin/.gitignore index 7d0393d..99d9929 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1 +1,14 @@ +/BigPoint.class +/Brick.class +/Game.class +/Ghost.class +/Hintergrund.class +/Lives.class +/Main.class +/Map.class /MapMenu$1.class +/MapMenu.class +/Picture.class +/Player.class +/Point.class +/Portal.class diff --git a/bin/BigPoint.class b/bin/BigPoint.class index c61b68a03100e48b0e700e8b5820a384917fb07d..e13d6a937dea2cd8c7a7638fd757da5d267f3548 100644 GIT binary patch delta 17 ZcmX@de2$sp)W2Q(7#J8#HgX(e1OP%*2A==` delta 17 ZcmX@de2$sp)W2Q(7#J8VH*y?f1OP&92BZK0 diff --git a/bin/Brick.class b/bin/Brick.class index 50ef0edbf9e3ab3e130be745f874a171441c4509..98f1c69aeacb64cc67c5adfd0911ce8b54b732c9 100644 GIT binary patch delta 17 ZcmX@ae2AIj)W2Q(7#J8#HgfD@1OPz1273Si delta 17 ZcmX@ae2AIj)W2Q(7#J8VH*)M^1OPzQ27mwn diff --git a/bin/Game.class b/bin/Game.class index c157166ae2ff0faad02bfff1fb5b5af0319c29dd..5844c8f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HuwN;{he{bfQXDv- zG~uAqijS3cbSRxTq;$cpc+jbw!Y9gke5zc)VdWZnlwa|gOPNG3>2bb47TZv*eHy-~1}_sRk9DIKPSTN+ zHKUG-NKbE24qhP>1tCKDSxtSg&4ms>aK=l}j!8=ygc|xjU_w0&2TaOFMZlz|P#iGX z3wOYj>y#QWR!2DXzH__M*R=U*F`Gd>ti+C!LWi@G$vKS?)5ymW^+ zOjEBfo}$)i+U5cc1_lO`jT}vk069zr(*OVf delta 17 YcmeBT?qcRR^>5cc1_lPpjT}vk06Ap^*Z=?k diff --git a/bin/Lives.class b/bin/Lives.class index 4ea4f45510b89d23fb76829c71c22f2b11f0a335..00ef1162bdb457b0ed92a93124b09ee5fdab4c5d 100644 GIT binary patch delta 17 Zcmcb>bb*QE)W2Q(7#J8#Hgb3{0sujJ1|t9f delta 17 Zcmcb>bb*QE)W2Q(7#J8VH*$C|0suji1}Fdk diff --git a/bin/Main.class b/bin/Main.class index 03e66e993ac51e4fd4ec8593e424a46501e6f51b..084339fa64c10c5228200fabc70fb3480b1b91fd 100644 GIT binary patch delta 17 ZcmZ3_wVsRP)W2Q(7#J8#Hgc%50suY?1=Iil delta 17 ZcmZ3_wVsRP)W2Q(7#J8VH*%=60suZG1=#=q diff --git a/bin/Map.class b/bin/Map.class index 47423ff42bbafc1084627284a21c2415bf36be68..386fbdb62118c81db0d62ebc282bfd3bb66adbbc 100644 GIT binary patch delta 17 ZcmX>jc1Dcj)W2Q(7#J8#HgdRd0{}x*21x(_ delta 17 ZcmX>jc1Dcj)W2Q(7#J8VH*&ae0{}y922KC~ diff --git a/bin/MapMenu.class b/bin/MapMenu.class index b1f4684edafcba58c489242bbc906766f4649be0..1d6814f611e5667368ec96aaea39e8f6d3c2ea4c 100644 GIT binary patch delta 30 mcmcaFeq5aE)W2Q(7#J8#7>;k`s^Hi>fkTIxk!kW?ZV3Rl?g~W! delta 55 zcmX>ueqWsH)W2Q(7#J8V8BT2Es^H*dWZ?EoEiUm*%}q)z+T6&Y%go3;c|ErT7sGL& KDi#JthBg2O4-c0B diff --git a/bin/Point.class b/bin/Point.class index 8be2f7a1f67e37435136adf1602e4faa71cbe644..c3665100b051335181c293b55e347e6a5994a0af 100644 GIT binary patch delta 17 ZcmX@ae2AIj)W2Q(7#J8#HgfD@1OPz1273Si delta 17 ZcmX@ae2AIj)W2Q(7#J8VH*)M^1OPzQ27mwn diff --git a/bin/Portal.class b/bin/Portal.class index be456d5791c24ac393be46ffdb9861982f972bda..1eaeaf93172d1466320cda5915b3d988546196d0 100644 GIT binary patch delta 17 ZcmX@ce2kgn)W2Q(7#J8#HgfD^1OP!q28RFu delta 17 ZcmX@ce2kgn)W2Q(7#J8VH*)M_1OP!@28;jz diff --git a/src/Game.java b/src/Game.java index 0f117fd..b29831e 100644 --- a/src/Game.java +++ b/src/Game.java @@ -292,6 +292,7 @@ public class Game { // Kollision von Pac-Man mit Bricks: for (int i = 0; i < 35; i++) { // für jeden Brick for (int j = 0; j < 35; j++) { // für jeden Brick + if (Map.bricks[j][i] != null) { // Damit kein Fehler auftritt wegen nicht vorhandenen Bricks if (player.getPos('x', 0) < Map.bricks[j][i].xPos + 20 && player.getPos('x', 0) > Map.bricks[j][i].xPos - 20 @@ -317,10 +318,6 @@ public class Game { } } - } - } - for (int i = 0; i < 35; i++) { - for (int j = 0; j < 35; j++) { if (Map.points[j][i] != null) { if (player.getPos('x', 0) < Map.points[j][i].xPos + 5 && player.getPos('x', 0) > Map.points[j][i].xPos - 5 @@ -336,32 +333,7 @@ public class Game { } } - } - } - if (Map.Left != null) { - if (player.getPos('x', 0) < Map.Left.xPos + 20 && player.getPos('x', 0) > Map.Left.xPos - 20 - && player.getPos('y', 0) < Map.Left.yPos + 20 && player.getPos('y', 0) > Map.Left.yPos - 20) { - if (Map.Right != null) { - player.xPos = Map.Right.xPos - 20; - player.yPos = Map.Right.yPos; - - } - } - } - if (Map.Right != null) { - if (player.getPos('x', 0) < Map.Right.xPos + 20 && player.getPos('x', 0) > Map.Right.xPos - 20 - && player.getPos('y', 0) < Map.Right.yPos + 20 && player.getPos('y', 0) > Map.Right.yPos - 20) { - - if (Map.Left != null) { - player.xPos = Map.Left.xPos + 20; - player.yPos = Map.Left.yPos; - - } - } - } - for (int i = 0; i < 35; i++) { - for (int j = 0; j < 35; j++) { if (Map.bigpoints[j][i] != null) { if (player.getPos('x', 0) < Map.bigpoints[j][i].xPos + 6 && player.getPos('x', 0) > Map.bigpoints[j][i].xPos - 6 @@ -395,6 +367,30 @@ public class Game { } } + + } + } + + if (Map.Left != null) { + if (player.getPos('x', 0) < Map.Left.xPos + 20 && player.getPos('x', 0) > Map.Left.xPos - 20 + && player.getPos('y', 0) < Map.Left.yPos + 20 && player.getPos('y', 0) > Map.Left.yPos - 20) { + + if (Map.Right != null) { + player.xPos = Map.Right.xPos - 20; + player.yPos = Map.Right.yPos; + + } + } + } + if (Map.Right != null) { + if (player.getPos('x', 0) < Map.Right.xPos + 20 && player.getPos('x', 0) > Map.Right.xPos - 20 + && player.getPos('y', 0) < Map.Right.yPos + 20 && player.getPos('y', 0) > Map.Right.yPos - 20) { + + if (Map.Left != null) { + player.xPos = Map.Left.xPos + 20; + player.yPos = Map.Left.yPos; + + } } }