From 8721ed3a91c5c946e8d254272996001aa952f22a Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Wed, 13 Mar 2019 03:27:25 -0700 Subject: [PATCH] Added notes on warp special tiles Fixed warp label positioning Fixed bug with player acting when animation was null --- core/src/com/riiablo/entity/Player.java | 2 +- core/src/com/riiablo/entity/Warp.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/com/riiablo/entity/Player.java b/core/src/com/riiablo/entity/Player.java index cba7c8b8..1c4c743c 100644 --- a/core/src/com/riiablo/entity/Player.java +++ b/core/src/com/riiablo/entity/Player.java @@ -162,7 +162,7 @@ public class Player extends Entity { @Override public void act(float delta) { super.act(delta); - if (animation != null && mode == getWalkMode() || mode == getRunMode()) { + if (animation != null && (mode == getWalkMode() || mode == getRunMode())) { int frame = animation.getFrame(); int numFrames = animation.getNumFramesPerDir(); if (frame == 0 || frame == numFrames >>> 1) { diff --git a/core/src/com/riiablo/entity/Warp.java b/core/src/com/riiablo/entity/Warp.java index 012d1f3b..a6b96ade 100644 --- a/core/src/com/riiablo/entity/Warp.java +++ b/core/src/com/riiablo/entity/Warp.java @@ -58,6 +58,15 @@ public class Warp extends Entity { /** * TODO: warp.LitVersion determines whether or not warp has special highlighted tiles * warp.Tile is added to subindex of tile to find corresponding highlighted tiles (if warp.LitVersion set) + * Above info is wrong -- unhighlighted 21/2 highlighted 21/6 -- might be hard-coded? table? + * All vanilla warps have warp.Tile == 2, only different ones are A5 barricade + * caves\cavedr.dt1 up replaces 4 tiles -- value == 2 and replaces 0-3 with 4-7 + * caves\cavedr.dt1 down replaces 4 tiles -- value == 2 and replaces 0-3 with 4-7 + * sewer\chamb.dt1 up replaces 2 tiles -- value == 2 and replaces 0-1 with 2-3 + * sewer\chamb.dt1 down replaces 4 tiles -- value == 2 and replaces 0-3 with 4-7 + * spider\spiderent.dt1 down replaces 4 tiles -- value == 2 and replaces 0-3 with 4-7 + * + * Subindex of special warp tile is the main index of the tiles it replaces */ } @@ -86,7 +95,7 @@ public class Warp extends Entity { @Override public void draw(PaletteIndexedBatch batch) { - label.setPosition(pixelLoc.x, pixelLoc.y + getLabelOffset() + label.getHeight() / 2, Align.center); + label.setPosition(pixelLoc.x + box.xMin + box.width / 2, pixelLoc.y - box.yMax + box.height / 2 + getLabelOffset() + label.getHeight() / 2, Align.center); } @Override