Skip to content

Commit

Permalink
Fix bug with choosing same world in world select screen messing up
Browse files Browse the repository at this point in the history
the next world.
Adjust saturation levels of slime death animation.
  • Loading branch information
SgtCoDFish committed Sep 23, 2014
1 parent 65ac8c8 commit 5a16476
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Binary file modified core/assets/monsters/slime_die_desat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions core/src/uk/org/ulcompsoc/tesseract/TesseractMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,16 @@ public void changeToWorld(int diffWorld) {
battleChangeFlag = worldChangeFlag = false;
Gdx.app.debug("WORLD_CHANGE", "Changing to world " + (diffWorld == -1 ? currentMapIndex : diffWorld) + ".");

if (diffWorld == currentMapIndex) {
diffWorld = -1;
}

if (diffWorld != -1) {
if (diffWorld >= maps.length) {
diffWorld = diffWorld % maps.length;
}

if (currentMapIndex != -1 && diffWorld != currentMapIndex) {
if (currentMapIndex != -1) {
worldEngines[currentMapIndex].removeEntity(worldPlayerEntity);
}

Expand All @@ -521,8 +525,9 @@ public void changeToWorld(int diffWorld) {

if (diffWorld != -1) {
worldPlayerEntity.add(getCurrentMap().findPlayerPosition());
currentEngine.addEntity(worldPlayerEntity);
musicManager.play(currentMapIndex);

currentEngine.addEntity(worldPlayerEntity);
}

((OrthographicCamera) camera).zoom = 0.5f;
Expand Down

0 comments on commit 5a16476

Please sign in to comment.