From af51d3776ee07363b9d3624e7524dbae86f1c9b9 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 1 Jul 2021 10:23:46 +0200 Subject: [PATCH] door colors on maps --- Zoelda/src/main/DoorTile.java | 12 +++++++----- Zoelda/src/main/maps/ImageMap.java | 6 +++--- Zoelda/src/main/worlds/TestWorld.java | 2 +- Zoelda/src/res/images/maps/map0a.png | Bin 201 -> 183 bytes Zoelda/src/res/images/maps/map1a.png | Bin 213 -> 180 bytes Zoelda/src/res/images/maps/map2a.png | Bin 194 -> 174 bytes Zoelda/src/res/images/maps/map4a.png | Bin 192 -> 162 bytes Zoelda/src/res/images/maps/map5a.png | Bin 181 -> 161 bytes Zoelda/src/res/images/maps/map6a.png | Bin 186 -> 163 bytes 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Zoelda/src/main/DoorTile.java b/Zoelda/src/main/DoorTile.java index 5ba5fc2..172d388 100644 --- a/Zoelda/src/main/DoorTile.java +++ b/Zoelda/src/main/DoorTile.java @@ -5,7 +5,7 @@ import main.entities.player.Player; import main.maps.Map; public class DoorTile extends Tile implements Ticker { - + public static final int TOP = 0; public static final int BOTTOM = 1; public static final int LEFT = 2; @@ -28,7 +28,9 @@ public class DoorTile extends Tile implements Ticker { float dist = player.dist(posX + 0.5f, posY + 0.5f); if (dist < 0.5f) { if (!waitForLeave) { - Main.instance.getWorld().changeMap(this); + if (connected != null) { + Main.instance.getWorld().changeMap(this); + } } } else { waitForLeave = false; @@ -43,11 +45,11 @@ public class DoorTile extends Tile implements Ticker { public void setSide(int side) { this.side = side; } - + public void setConnectedDoor(DoorTile door) { connected = door; } - + public DoorTile getConnectedDoor() { return connected; } @@ -59,7 +61,7 @@ public class DoorTile extends Tile implements Ticker { public void waitForLeave() { waitForLeave = true; } - + @Override public DoorTile clone() { DoorTile t = new DoorTile(getID(), posX, posY, map); diff --git a/Zoelda/src/main/maps/ImageMap.java b/Zoelda/src/main/maps/ImageMap.java index 4be00d9..5104c42 100644 --- a/Zoelda/src/main/maps/ImageMap.java +++ b/Zoelda/src/main/maps/ImageMap.java @@ -52,7 +52,7 @@ public class ImageMap extends Map { } if (id == Tile.DOOR_RIGHT ) { DoorTile door = new DoorTile(id, x, y, this); - leftDoor = door; + rightDoor = door; door.setSide(DoorTile.RIGHT); tiles[x][y] = door; add(tiles[x][y]); @@ -60,7 +60,7 @@ public class ImageMap extends Map { } if (id == Tile.DOOR_TOP) { DoorTile door = new DoorTile(id, x, y, this); - leftDoor = door; + topDoor = door; door.setSide(DoorTile.TOP); tiles[x][y] = door; add(tiles[x][y]); @@ -68,7 +68,7 @@ public class ImageMap extends Map { } if (id == Tile.DOOR_BOTTOM) { DoorTile door = new DoorTile(id, x, y, this); - leftDoor = door; + bottomDoor = door; door.setSide(DoorTile.BOTTOM); tiles[x][y] = door; add(tiles[x][y]); diff --git a/Zoelda/src/main/worlds/TestWorld.java b/Zoelda/src/main/worlds/TestWorld.java index da2a681..dadf214 100644 --- a/Zoelda/src/main/worlds/TestWorld.java +++ b/Zoelda/src/main/worlds/TestWorld.java @@ -10,7 +10,7 @@ public class TestWorld extends World { super(4); Map m2 = maps[3].clone(); - getCurrentMap().connectDoors(getCurrentMap().leftDoor, m2.leftDoor); + getCurrentMap().connectDoors(getCurrentMap().bottomDoor, m2.topDoor); for (int i = 0; i < 15; i++) { Coin c = new Coin(); diff --git a/Zoelda/src/res/images/maps/map0a.png b/Zoelda/src/res/images/maps/map0a.png index 8ff991a1dc02e822403a8f8c610c57bede9128c8..791cf97b716a149eb50e0918ad4b059b66f69dfd 100644 GIT binary patch delta 138 zcmX@fxSer=1SbnK0|P@)=BfONiV9_-0X`wFDJdxolc!CbII+II{{J)v*J%vXrZHUe z{;>_Hkh8!evY3H^Z$Ah#TCfJI00p%@T^vIsE+;cExd|LRuw==SHA|KpIdC9{hwX;M oIRQ5YJJSL-fenTR1_lfaB1^dWJw2sOfZ7;5UHx3vIVCg!0168##sB~S delta 157 zcmdnac#?5~1Sba@0|UbX_v*Mp72n^ZOfUHx3v IIVCg!04*Lj3jhEB diff --git a/Zoelda/src/res/images/maps/map1a.png b/Zoelda/src/res/images/maps/map1a.png index e6b351ebb1dc7e23d63053d445b91a8e9de165a9..021cc983f233e7ed18bedf065ba27d17d704fcb3 100644 GIT binary patch delta 135 zcmcc0xP@_o1SbnK0|P@)=BfONiVDS|0X`wFDJdxolc!CbII+II{`c?3|I-*;r!m~x z=Jp1tkh8!evY3H^Z$Ah#TCfJI00lKXT^vIsE+;cExd|LRuw==SHA|KpIdC9}hwX-h kqJSHdooN9Zi-7?HgNzlop-&OlU7#KYPgg&ebxsLQ0O!Ukxc~qF delta 169 zcmdnOc$IO21Sba@0|UbX_v*Mp72n^wwlWc)I$ztaD0e0s!{tIgtPW diff --git a/Zoelda/src/res/images/maps/map2a.png b/Zoelda/src/res/images/maps/map2a.png index f0fe7ae5209d4e6abb7c1d6be38955cde8a1055d..b609d719a290aca7542edc07d0c7968706806324 100644 GIT binary patch delta 109 zcmX@axQ=mx1SbnK0|P@)=BfONiVD&~0X`wFKz>R}%EXBi>+9=Xr!h>M#-MwIb@4d(sk<*ns9R Nc)I$ztaD0e0sz?LAPxWk delta 131 zcmV-}0DS+h0m1>07zqdl0001>N7r1DAs~@o6>L{YL_t(2Q)6UcVE7NjWC129O%|X? zGlsKMQc|ESOfYB894HF{u-dGvtBZlL0j!$ey?cj&9~zrQPoF*o l<748Da5gqDP>F002ovPDHLkV1g#0Flzt+ diff --git a/Zoelda/src/res/images/maps/map4a.png b/Zoelda/src/res/images/maps/map4a.png index f218414ed28742f0161e3f3e22e05e6d91e9bc3e..5d545ef251bbcffd666d4195cf5f328280178faf 100644 GIT binary patch delta 146 zcmX@WxQKCrL_G^L0|P@)=Ba!j#aJBV?!>U}oXkrghb7(7*O7r?V?XzwL{=c5Kfou% zH63x+e>c|G*H4?q@KP}F2vCZ%z$3Dlfq`#72s2u+2CD!CWjtLRLnJOIH!!<7 r8YCnn7_l*TNje-jbl|`N28JshTs%zkwiPpQ166vu`njxgN@xNAGIA>_ delta 176 zcmZ3)cz|(&L_G%^0|UbX_v7X7cnq! z%>3+o=H!`Rj&nY~=g#?_InB(VeTa4Sv!MHdK&9@UE{-7@!O1?Jo9FEn6-J6oxzqZf0S=Bs7)$W$dtJ1lk_4`QzYR*#kn&zJy-pd7hCc?KezNj b2|t6xY2IV2T6Ql4n#thl>gTe~DWM4f)wV?@ diff --git a/Zoelda/src/res/images/maps/map5a.png b/Zoelda/src/res/images/maps/map5a.png index 95e23b76754f783c293ffcc7a55b4d01c2013af8..2848ff6ead35e6b4b9c32d001b4537dab4a43d15 100644 GIT binary patch delta 96 zcmdnWxR7yz1SbnK0|P@)=BfONiVC7U0X`wFDJdxvCr+%dum3-dq3YfJs)=?I#&Vu6 zjv*44lN*@b91Ri@5`vhRb9j{R1kK>#NJwB{@Y}-9QGDuBFVH9kPgg&ebxsLQ0OP

f(*gKvtbRl+3u=}f7U m_}DI-516In;K-Gnz`zh+BDkN&Ug$5-R0dC1KbLh*2~7ZA^DLkM diff --git a/Zoelda/src/res/images/maps/map6a.png b/Zoelda/src/res/images/maps/map6a.png index afcc9e09a1731d0cf22039b1230b501bda9ddb81..3edae5fa45302ea15a42d7ee903e0cf497066a7a 100644 GIT binary patch delta 98 zcmV-o0GVn9|Or7r&3^qK>XEuc(roP3^BK rjhv^{xO=kH1Ot{x=5rn9mylrCYAv#V_xr~nqZvG1{an^LB{Ts5C!sD>