From 1466ba041abf5d2841e44dbb1a08f0afdbf5fe4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Thu, 9 Jun 2022 21:07:13 +0200 Subject: [PATCH 1/4] detect enemy --- resources/map/Maps.tiled-session | 12 ++++++------ src/Entity/Player.java | 30 +++++++++++++++++++++++------- src/Main/PokeMudry.java | 10 +--------- src/Main/Settings.java | 4 ++-- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/resources/map/Maps.tiled-session b/resources/map/Maps.tiled-session index 16e8d38..e5b606d 100644 --- a/resources/map/Maps.tiled-session +++ b/resources/map/Maps.tiled-session @@ -197,8 +197,8 @@ "scale": 0.75, "selectedLayer": 1, "viewCenter": { - "x": 640.6666666666667, - "y": 640.6666666666666 + "x": 640, + "y": 640 } }, "desert.tmx#Desert": { @@ -212,8 +212,8 @@ "scale": 1.5, "selectedLayer": 1, "viewCenter": { - "x": 160.33333333333331, - "y": 160.33333333333331 + "x": 159.33333333333331, + "y": 160.66666666666663 } }, "test.tmx#test": { @@ -227,8 +227,8 @@ "scale": 1, "selectedLayer": 4, "viewCenter": { - "x": 320.5, - "y": 159.5 + "x": 351, + "y": 196 } }, "test_couloir.tmx#Dungeon_Tileset": { diff --git a/src/Entity/Player.java b/src/Entity/Player.java index 06c6d45..542bf8d 100644 --- a/src/Entity/Player.java +++ b/src/Entity/Player.java @@ -7,6 +7,7 @@ import com.badlogic.gdx.maps.tiled.TiledMapTile; import com.badlogic.gdx.math.Vector2; import Control.Controller; +import Main.PokeMudry; import Screen.ScreenMap; public class Player extends Character{ @@ -29,25 +30,34 @@ public class Player extends Character{ // Compute direction and next cell Vector nextCell = new Vector<>(); Player.Direction goalDirection = Player.Direction.NULL; + Vector2 nextPos = position; if (c.keyStatus.get(Input.Keys.RIGHT)) { goalDirection = Player.Direction.RIGHT; nextCell = sm.getTile(getPosition(), 1, 0); + nextPos.x+=sm.tileWidth; } else if (c.keyStatus.get(Input.Keys.LEFT)) { goalDirection = Player.Direction.LEFT; nextCell = sm.getTile(getPosition(), -1, 0); + nextPos.x-=sm.tileWidth; } else if (c.keyStatus.get(Input.Keys.UP)) { goalDirection = Player.Direction.UP; nextCell = sm.getTile(getPosition(), 0, 1); + nextPos.y+=sm.tileHeight; } else if (c.keyStatus.get(Input.Keys.DOWN)) { goalDirection = Player.Direction.DOWN; nextCell = sm.getTile(getPosition(), 0, -1); + nextPos.y-=sm.tileHeight; } // Is the move valid ? if (sm.isWalkable(nextCell)) { - setSpeed(sm.getSpeed(nextCell)); - go(goalDirection); + if (enemy(sm, nextPos)) { + System.out.println("It's a enemy !!"); + } else { + setSpeed(sm.getSpeed(nextCell)); + go(goalDirection); + } } else { // Face the wall turn(goalDirection); @@ -72,11 +82,17 @@ public class Player extends Character{ } } - private boolean enemy() { - //Vector enemies = PokeMudry.getEnemies; - //for (Enemy enemy : enemies) { - - //} + private boolean enemy(ScreenMap sm, Vector2 nextPos) { + Vector enemies = PokeMudry.getEnemies(); + for (Enemy enemy : enemies) { + boolean bMap = sm.map.equals(enemy.getMap()); + int pX = (int) nextPos.x/sm.tileWidth; + int pY = (int) nextPos.y/sm.tileHeight; + int eX = (int) enemy.position.x/sm.tileWidth; + int eY = (int) enemy.position.y/sm.tileHeight; + //System.out.println("Player: " + pX + " x " + pY + " - Enemy: " + eX + " x " + eY); + if(bMap && pX==eX && pY==eY) return true; + } return false; } diff --git a/src/Main/PokeMudry.java b/src/Main/PokeMudry.java index ae3b330..790e0df 100644 --- a/src/Main/PokeMudry.java +++ b/src/Main/PokeMudry.java @@ -13,17 +13,9 @@ import ch.hevs.gdx2d.desktop.PortableApplication; import ch.hevs.gdx2d.lib.GdxGraphics; public class PokeMudry extends PortableApplication { - - public final boolean ANDROID = false; - public final int PLAYERS = 1; - public static final int TIME = 10; // number of minutes for kill all enemy - - public static final int HEIGHT = 800; - public static final int width = 800; private ScreenPlayer sp; private Controller controller; - //private Player p1; private static Vector enemies = new Vector<>(); private static Vector entities = new Vector<>(); @@ -48,7 +40,7 @@ public class PokeMudry extends PortableApplication { controller.init(); entities.add((Entity) sp.p); enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert")); - enemies.add(new Enemy("Pignat", 12, 15, "lumberjack_sheet32", "desert")); + enemies.add(new Enemy("Pignat", 5, 1, "lumberjack_sheet32", "test")); for (Enemy enemy : enemies) { entities.add(enemy); diff --git a/src/Main/Settings.java b/src/Main/Settings.java index cd99584..fe96e1e 100644 --- a/src/Main/Settings.java +++ b/src/Main/Settings.java @@ -2,8 +2,8 @@ package Main; public class Settings { - public final boolean ANDROID = false; - public final int PLAYERS = 1; + public static final boolean ANDROID = false; + public static final int PLAYERS = 1; public static final int TIME = 10; // number of minutes for kill all enemy public static final int SIDE = 800; From 56d57ca17ccab08e120e1324574d885a49f4adf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Fri, 10 Jun 2022 16:39:50 +0200 Subject: [PATCH 2/4] enemy integration done, but big bug when move --- resources/map/Maps.tiled-session | 13 +++++++------ resources/map/test_couloir.tmx | 12 ++++++------ src/Entity/Character.java | 5 ++--- src/Entity/Enemy.java | 8 +------- src/Entity/Entity.java | 17 ++++++++++------- src/Entity/Player.java | 7 ++++--- src/Entity/Stuff.java | 4 ++-- src/Main/PokeMudry.java | 4 +--- src/Screen/ScreenMap.java | 20 +++++++++++++------- src/Screen/ScreenPlayer.java | 5 ++--- 10 files changed, 48 insertions(+), 47 deletions(-) diff --git a/resources/map/Maps.tiled-session b/resources/map/Maps.tiled-session index e5b606d..58fc577 100644 --- a/resources/map/Maps.tiled-session +++ b/resources/map/Maps.tiled-session @@ -10,7 +10,8 @@ "file.lastUsedOpenFilter": "Fichiers de jeu de tuiles Tiled (*.tsx *.xml)", "fileStates": { "": { - "scaleInDock": 1 + "scaleInDock": 1, + "scaleInEditor": 1 }, "C:/Users/remi/AppData/Roaming/Tiled/#Tests": { "dynamicWrapping": true @@ -212,8 +213,8 @@ "scale": 1.5, "selectedLayer": 1, "viewCenter": { - "x": 159.33333333333331, - "y": 160.66666666666663 + "x": 160.66666666666669, + "y": 160.33333333333331 } }, "test.tmx#test": { @@ -224,11 +225,11 @@ "expandedObjectLayers": [ 9 ], - "scale": 1, + "scale": 3, "selectedLayer": 4, "viewCenter": { - "x": 351, - "y": 196 + "x": 62.66666666666667, + "y": 172.83333333333331 } }, "test_couloir.tmx#Dungeon_Tileset": { diff --git a/resources/map/test_couloir.tmx b/resources/map/test_couloir.tmx index 0cc80cb..bb2d47c 100644 --- a/resources/map/test_couloir.tmx +++ b/resources/map/test_couloir.tmx @@ -8984,8 +8984,8 @@ 956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956, -956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956, -1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079, +956,956,956,1113,1113,956,956,956,956,956,956,956,956,956,956,1113,1113,956,956,956, +1079,1079,1079,1113,1113,1079,1079,1079,1079,1079,1079,1079,1079,1079,1079,1113,1113,1079,1079,1079, 1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113, 1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113, 1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113,1113, @@ -9024,28 +9024,28 @@ - + - + - + - + diff --git a/src/Entity/Character.java b/src/Entity/Character.java index 8415477..934736d 100644 --- a/src/Entity/Character.java +++ b/src/Entity/Character.java @@ -32,10 +32,9 @@ public abstract class Character extends Entity{ protected int pv; - public Character(String name, int x, int y, String img){ - super(name, x, y); + public Character(String name, int x, int y, String img, String map){ + super(name, x, y, map); this.img = img; - } @Override diff --git a/src/Entity/Enemy.java b/src/Entity/Enemy.java index cf16b62..27f888f 100644 --- a/src/Entity/Enemy.java +++ b/src/Entity/Enemy.java @@ -5,16 +5,14 @@ import com.badlogic.gdx.math.Vector2; import Text.TextEnemy; public class Enemy extends Character{ - private String map; public TextEnemy textEnemy; public Enemy(String name, int x, int y, String img, String map) { - super(name, x, y, img); + super(name, x, y, img, map); //generate his text this.textEnemy = new TextEnemy("enemi"); //TODO should be name textEnemy.generateText(); - this.map = map; turn(Character.Direction.DOWN); //generate the vector of fight @@ -22,10 +20,6 @@ public class Enemy extends Character{ } - public String getMap() { - return map; - } - public void setPosition(int x, int y, String map){ position.set(x, y); this.map = map; diff --git a/src/Entity/Entity.java b/src/Entity/Entity.java index 42b8728..9d69b21 100644 --- a/src/Entity/Entity.java +++ b/src/Entity/Entity.java @@ -8,6 +8,7 @@ import ch.hevs.gdx2d.lib.interfaces.DrawableObject; public abstract class Entity implements DrawableObject { protected String name; + protected String map; Spritesheet ss; @@ -20,19 +21,17 @@ public abstract class Entity implements DrawableObject { protected boolean move = false; - public Entity(String name){ - this(name, new Vector2(0,0)); + + public Entity(String name, int x, int y, String map){ + this(name, new Vector2(SPRITE_WIDTH * x, SPRITE_HEIGHT * y), map); } - public Entity(String name, int x, int y){ - this(name, new Vector2(SPRITE_WIDTH * x, SPRITE_HEIGHT * y)); - } - - public Entity(String name, Vector2 initialPosition){ + public Entity(String name, Vector2 initialPosition, String map){ this.name = name; lastPosition = new Vector2(initialPosition); newPosition = new Vector2(initialPosition); position = new Vector2(initialPosition); + this.map = map; } public void init(){ @@ -58,4 +57,8 @@ public abstract class Entity implements DrawableObject { public String getName() { return name; } + + public String getMap() { + return map; + } } diff --git a/src/Entity/Player.java b/src/Entity/Player.java index 542bf8d..1eb7a55 100644 --- a/src/Entity/Player.java +++ b/src/Entity/Player.java @@ -14,8 +14,8 @@ public class Player extends Character{ private int xp; - public Player(int x, int y) { - super("Player", x, y, "Character"); + public Player(int x, int y, String map) { + super("Player", x, y, "lumberjack_sheet32", map); } public void addXp(int xp){ @@ -52,6 +52,7 @@ public class Player extends Character{ // Is the move valid ? if (sm.isWalkable(nextCell)) { + if (enemy(sm, nextPos)) { System.out.println("It's a enemy !!"); } else { @@ -75,7 +76,7 @@ public class Player extends Character{ } catch (Exception e) { } ScreenMap.Door.reset(); if (nMap == null || x == null || y == null) return; - sm.map = nMap; + map = nMap; setPosition(x*sm.tileWidth, y*sm.tileHeight); System.out.println("Go to: " + sm.map + " in " + x + " x " + y); } diff --git a/src/Entity/Stuff.java b/src/Entity/Stuff.java index 3afa338..6562e43 100644 --- a/src/Entity/Stuff.java +++ b/src/Entity/Stuff.java @@ -4,8 +4,8 @@ import ch.hevs.gdx2d.lib.GdxGraphics; public class Stuff extends Entity{ - public Stuff(String name) { - super(name); + public Stuff(String name, int x, int y, String map) { + super(name, x, y, map); //TODO Auto-generated constructor stub } diff --git a/src/Main/PokeMudry.java b/src/Main/PokeMudry.java index 790e0df..f2b08b6 100644 --- a/src/Main/PokeMudry.java +++ b/src/Main/PokeMudry.java @@ -57,7 +57,7 @@ public class PokeMudry extends PortableApplication { sp.p.manageEntity(sp.sm, controller); sp.render(g); for (Entity entity : entities) { - entity.graphicRender(g); + if (entity.getMap().equals(sp.sm.map)) entity.graphicRender(g); } } @@ -71,8 +71,6 @@ public class PokeMudry extends PortableApplication { case Input.Keys.Z: if (sp.sm.zoom == 1.0) { sp.sm.zoom = 0.5f; - } else if (sp.sm.zoom == 0.5) { - sp.sm.zoom = 0.25f; } else { sp.sm.zoom = 1; } diff --git a/src/Screen/ScreenMap.java b/src/Screen/ScreenMap.java index 9a109db..bc424aa 100644 --- a/src/Screen/ScreenMap.java +++ b/src/Screen/ScreenMap.java @@ -27,12 +27,13 @@ public class ScreenMap extends RenderingScreen{ private MapObjects doors; Map tMap = new TreeMap(); Map tMapRenderer = new TreeMap(); - public String map = "desert"; + public String map = "test_couloir"; public float zoom; private int width; public int tileWidth; private int height; public int tileHeight; + private Player player; @@ -47,6 +48,8 @@ public class ScreenMap extends RenderingScreen{ // Set initial zoom zoom = 1; + try { map = player.getMap(); } catch (Exception e) {} + // create map createMap("test"); createMap("test_couloir"); @@ -57,6 +60,9 @@ public class ScreenMap extends RenderingScreen{ public void onGraphicRender(GdxGraphics g) { tiledLayer.clear(); + + try { map = player.getMap(); } catch (Exception e) {} + for (int i = 0; i < 50; i++) { try { tiledLayer.add((TiledMapTileLayer) tMap.get(map).getLayers().get(i)); } catch (Exception e) { } } @@ -73,18 +79,14 @@ public class ScreenMap extends RenderingScreen{ // Render the tileMap + g.zoom(zoom); + g.moveCamera(player.getPosition().x, player.getPosition().y, width * tileWidth, height * tileHeight); tMapRenderer.get(map).setView(g.getCamera()); tMapRenderer.get(map).render(); g.drawFPS(); } - void camera(GdxGraphics g, Player player){ - g.zoom(zoom); - g.moveCamera(player.getPosition().x, player.getPosition().y, width * tileWidth, height * tileHeight); - - } - public Vector getTile(Vector2 position, int offsetX, int offsetY) { Vector tiles = new Vector<>(); @@ -165,4 +167,8 @@ public class ScreenMap extends RenderingScreen{ nextY = null; } } + + public void setPlayer(Player p) { + player = p; + } } diff --git a/src/Screen/ScreenPlayer.java b/src/Screen/ScreenPlayer.java index 042a75e..20cdcbe 100644 --- a/src/Screen/ScreenPlayer.java +++ b/src/Screen/ScreenPlayer.java @@ -8,17 +8,16 @@ public class ScreenPlayer { public Player p; public ScreenMap sm; - public void init(){ + p = new Player(8, 15, "desert"); screenManager.registerScreen(ScreenMap.class); screenManager.registerScreen(ScreenBattle.class); sm = screenManager.getScreenMap(); - p = new Player(8, 15); } public void render(GdxGraphics g){ + sm.setPlayer(p); screenManager.render(g); - sm.camera(g, p); } } \ No newline at end of file From 697c9e659f7e8fd4f7eaf66cbf7e30c63f8e6d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Fri, 10 Jun 2022 18:49:02 +0200 Subject: [PATCH 3/4] switch screen --- src/Entity/Player.java | 20 ++++++++++---------- src/Main/PokeMudry.java | 22 +++++++++++++++------- src/Screen/ManagerOfScreen.java | 5 ++--- src/Screen/ScreenBattle.java | 5 +++++ src/Screen/ScreenMap.java | 9 +++++++-- src/Screen/ScreenPlayer.java | 5 +++++ 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/Entity/Player.java b/src/Entity/Player.java index 1eb7a55..ed31a4b 100644 --- a/src/Entity/Player.java +++ b/src/Entity/Player.java @@ -1,5 +1,6 @@ package Entity; +import java.util.TreeMap; import java.util.Vector; import com.badlogic.gdx.Input; @@ -13,9 +14,11 @@ import Screen.ScreenMap; public class Player extends Character{ private int xp; + public Enemy lastEnemy = null; + public boolean frontOfEnemy = false; public Player(int x, int y, String map) { - super("Player", x, y, "lumberjack_sheet32", map); + super("Player", x, y, "Character", map); } public void addXp(int xp){ @@ -54,6 +57,7 @@ public class Player extends Character{ if (sm.isWalkable(nextCell)) { if (enemy(sm, nextPos)) { + //turn(goalDirection); System.out.println("It's a enemy !!"); } else { setSpeed(sm.getSpeed(nextCell)); @@ -92,19 +96,15 @@ public class Player extends Character{ int eX = (int) enemy.position.x/sm.tileWidth; int eY = (int) enemy.position.y/sm.tileHeight; //System.out.println("Player: " + pX + " x " + pY + " - Enemy: " + eX + " x " + eY); - if(bMap && pX==eX && pY==eY) return true; + if(bMap && pX==eX && pY==eY) { + lastEnemy = enemy; + frontOfEnemy = true; + return true; + } } return false; } - public void move(int x, int y){ - - } - - public void move(Vector2 vMove){ - move((int)vMove.x, (int)vMove.y); - } - @Override protected void removedPv(int pv) { // TODO Auto-generated method stub diff --git a/src/Main/PokeMudry.java b/src/Main/PokeMudry.java index f2b08b6..84d765f 100644 --- a/src/Main/PokeMudry.java +++ b/src/Main/PokeMudry.java @@ -2,12 +2,14 @@ package Main; import java.util.Vector; +import java.util.Map.Entry; import com.badlogic.gdx.Input; import Control.Controller; import Entity.Enemy; import Entity.Entity; +import Screen.ScreenMap; import Screen.ScreenPlayer; import ch.hevs.gdx2d.desktop.PortableApplication; import ch.hevs.gdx2d.lib.GdxGraphics; @@ -42,13 +44,9 @@ public class PokeMudry extends PortableApplication { enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert")); enemies.add(new Enemy("Pignat", 5, 1, "lumberjack_sheet32", "test")); - for (Enemy enemy : enemies) { - entities.add(enemy); - } + for (Enemy enemy : enemies) { entities.add(enemy); } - for (Entity entity : entities) { - entity.init(); - } + for (Entity entity : entities) { entity.init(); } } @Override @@ -56,9 +54,19 @@ public class PokeMudry extends PortableApplication { g.clear(); sp.p.manageEntity(sp.sm, controller); sp.render(g); + System.out.println(sp.screenManager.getActiveScreen().getClass()); + //System.out.println(ScreenMap.class); for (Entity entity : entities) { - if (entity.getMap().equals(sp.sm.map)) entity.graphicRender(g); + + if (entity.getMap().equals(sp.sm.map) && sp.screenManager.getActiveScreen().getClass().equals(ScreenMap.class)) + entity.graphicRender(g); } + + if (sp.p.frontOfEnemy && sp.screenManager.getActiveScreen().getClass().equals(ScreenMap.class)){ + sp.e = sp.p.lastEnemy; + System.out.println("switch screen"); + sp.screenManager.activateNextScreen(); + } } diff --git a/src/Screen/ManagerOfScreen.java b/src/Screen/ManagerOfScreen.java index e53db94..0d5e92a 100644 --- a/src/Screen/ManagerOfScreen.java +++ b/src/Screen/ManagerOfScreen.java @@ -4,15 +4,14 @@ import ch.hevs.gdx2d.lib.ScreenManager; public class ManagerOfScreen extends ScreenManager{ ManagerOfScreen(){ - } - ScreenMap getScreenMap(){ + public ScreenMap getScreenMap(){ this.activateScreen(0); return (ScreenMap)this.getActiveScreen(); } - ScreenBattle getScreenBattle(){ + public ScreenBattle getScreenBattle(){ this.activateScreen(1); return (ScreenBattle)this.getActiveScreen(); } diff --git a/src/Screen/ScreenBattle.java b/src/Screen/ScreenBattle.java index 3ee7029..86964f3 100644 --- a/src/Screen/ScreenBattle.java +++ b/src/Screen/ScreenBattle.java @@ -20,6 +20,7 @@ public class ScreenBattle extends RenderingScreen{ private static int EDGE = 10; private static int HEIGHT_DIALOG = Settings.SIDE / 3; private static int WIDTH_DIALOG = Settings.SIDE - 2*EDGE; + private Enemy e; private boolean attackOn; private int numAttack =0; @@ -60,6 +61,10 @@ public class ScreenBattle extends RenderingScreen{ } + public void setEnemy(Enemy e) { + this.e = e; + } + public void displayEnemy(Enemy e){ // stock his speech diff --git a/src/Screen/ScreenMap.java b/src/Screen/ScreenMap.java index bc424aa..9cd2527 100644 --- a/src/Screen/ScreenMap.java +++ b/src/Screen/ScreenMap.java @@ -79,8 +79,13 @@ public class ScreenMap extends RenderingScreen{ // Render the tileMap - g.zoom(zoom); - g.moveCamera(player.getPosition().x, player.getPosition().y, width * tileWidth, height * tileHeight); + try { + g.zoom(zoom); + g.moveCamera(player.getPosition().x, player.getPosition().y, width * tileWidth, height * tileHeight); + } catch (Exception e) { + //TODO: handle exception + } + tMapRenderer.get(map).setView(g.getCamera()); tMapRenderer.get(map).render(); diff --git a/src/Screen/ScreenPlayer.java b/src/Screen/ScreenPlayer.java index 20cdcbe..a445491 100644 --- a/src/Screen/ScreenPlayer.java +++ b/src/Screen/ScreenPlayer.java @@ -1,21 +1,26 @@ package Screen; +import Entity.Enemy; import Entity.Player; import ch.hevs.gdx2d.lib.GdxGraphics; public class ScreenPlayer { public ManagerOfScreen screenManager = new ManagerOfScreen(); public Player p; + public Enemy e; public ScreenMap sm; + public ScreenBattle sb; public void init(){ p = new Player(8, 15, "desert"); screenManager.registerScreen(ScreenMap.class); screenManager.registerScreen(ScreenBattle.class); + sb = screenManager.getScreenBattle(); sm = screenManager.getScreenMap(); } public void render(GdxGraphics g){ + sb.setEnemy(e); sm.setPlayer(p); screenManager.render(g); } From 91fda1acee76b8ee61a3a1f95147d18a3058a5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Fri, 10 Jun 2022 18:59:59 +0200 Subject: [PATCH 4/4] reset camera --- src/Main/PokeMudry.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Main/PokeMudry.java b/src/Main/PokeMudry.java index 84d765f..094fdbe 100644 --- a/src/Main/PokeMudry.java +++ b/src/Main/PokeMudry.java @@ -66,6 +66,7 @@ public class PokeMudry extends PortableApplication { sp.e = sp.p.lastEnemy; System.out.println("switch screen"); sp.screenManager.activateNextScreen(); + g.resetCamera(); } }