mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
@@ -191,8 +191,6 @@ public class MapActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean collideWithPlayer(PlayerSprite other) {
|
public boolean collideWithPlayer(PlayerSprite other) {
|
||||||
|
|
||||||
|
|
||||||
boolean newIsColliding = collideWith(other);
|
boolean newIsColliding = collideWith(other);
|
||||||
if (newIsColliding) {
|
if (newIsColliding) {
|
||||||
if (!isCollidingWithPlayer)
|
if (!isCollidingWithPlayer)
|
||||||
@@ -205,6 +203,8 @@ public class MapActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean collideWith(Rectangle other) {
|
public boolean collideWith(Rectangle other) {
|
||||||
|
if (getCollisionHeight() == 0f)
|
||||||
|
return false;
|
||||||
return boundingRect().overlaps(other);
|
return boundingRect().overlaps(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,20 +22,22 @@ public class MapSprite extends Actor {
|
|||||||
static public int BackgroundLayer = -1;
|
static public int BackgroundLayer = -1;
|
||||||
static public int SpriteLayer = 0;
|
static public int SpriteLayer = 0;
|
||||||
TextureRegion texture;
|
TextureRegion texture;
|
||||||
TextraLabel searchPost;
|
TextraLabel searchPost = Controls.newTextraLabel("[%80][+SearchPost]");
|
||||||
boolean isCaveDungeon, isOldorVisited;
|
boolean isCaveDungeon, isOldorVisited;
|
||||||
PointOfInterest poi;
|
|
||||||
|
|
||||||
public MapSprite(Vector2 pos, TextureRegion sprite, PointOfInterest point) {
|
public MapSprite(Vector2 pos, TextureRegion sprite, PointOfInterest point) {
|
||||||
poi = point;
|
if (point != null) {
|
||||||
isCaveDungeon = point != null && (point.getData().type.equalsIgnoreCase("cave") || point.getData().type.equalsIgnoreCase("dungeon"));
|
isCaveDungeon = "cave".equalsIgnoreCase(point.getData().type) || "dungeon".equalsIgnoreCase(point.getData().type);
|
||||||
isOldorVisited = poi != null && WorldSave.getCurrentSave().getPointOfInterestChanges(poi.getID() + poi.getData().map).hasDeletedObjects();
|
if (point.getData().map != null && point.getID() != null) {
|
||||||
searchPost = Controls.newTextraLabel("[%80][+SearchPost]");
|
isOldorVisited = WorldSave.getCurrentSave().getPointOfInterestChanges(point.getID() + point.getData().map).hasDeletedObjects();
|
||||||
|
}
|
||||||
|
}
|
||||||
texture = sprite;
|
texture = sprite;
|
||||||
setPosition(pos.x, pos.y);
|
setPosition(pos.x, pos.y);
|
||||||
setHeight(texture.getRegionHeight());
|
setHeight(texture.getRegionHeight());
|
||||||
setWidth(texture.getRegionWidth());
|
setWidth(texture.getRegionWidth());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkOut() {
|
public void checkOut() {
|
||||||
isOldorVisited = true;
|
isOldorVisited = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user