Skip to content
Snippets Groups Projects
Commit 0612abe7 authored by Matyáš Latner's avatar Matyáš Latner
Browse files

In the Darkness game remove player after game complete

parent 48c2c45f
No related branches found
No related tags found
No related merge requests found
......@@ -284,7 +284,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
actionsStripWidget.setStartButton(startButton);
actionsWidget = showActionsWidget(actionsStripWidget, getInTheDarknessDifficulty());
player = showPlayer();
showPlayer();
prepareGameInfos();
prepareDimmer();
......@@ -635,10 +635,12 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
//////////////////////////////////////////// PLAYER
private Player showPlayer() {
Player pl = new Player(INITIAL_MAP_WIDGET, this);
GameLayer.PLAYER_LAYER.getLayerEntity().addActor(pl);
return pl;
private void showPlayer() {
if (player != null) {
player.remove();
}
player = new Player(INITIAL_MAP_WIDGET, this);
GameLayer.PLAYER_LAYER.getLayerEntity().addActor(player);
}
private void resetPlayer() {
......
......@@ -160,8 +160,6 @@ public class Player extends Group {
replacePlayerSprite(playerWalkAnimatedImage);
hasKey = false;
setDebug(TablexiaSettings.getInstance().isShowBoundingBoxes(), true);
}
public void setActualFloor(int actualFloor) {
......@@ -182,7 +180,7 @@ public class Player extends Group {
/**
* Set player direction to one of possible directions in current player tile.
* In priority RIGHT, TOP, BOTTTOM, LEFT
* In priority RIGHT, TOP, BOTTOM, LEFT
*/
public void setPossibleDirection(TileMap tileMap) {
if (actualTileMapPosition != null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment