From 876cc9192ee3d161e6040de948611b607793f36f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Thu, 9 Jun 2022 19:20:43 +0200 Subject: [PATCH] poslish of polish --- src/Entity/Enemy.java | 5 +-- src/Main/PokeMudry.java | 6 +-- src/PokeMudry.java | 99 ----------------------------------------- src/testYann.java | 5 +-- 4 files changed, 4 insertions(+), 111 deletions(-) delete mode 100644 src/PokeMudry.java diff --git a/src/Entity/Enemy.java b/src/Entity/Enemy.java index ff43842..cf16b62 100644 --- a/src/Entity/Enemy.java +++ b/src/Entity/Enemy.java @@ -1,11 +1,8 @@ package Entity; -import Text.FightData; -import Text.TextEnemy; - import com.badlogic.gdx.math.Vector2; -import ch.hevs.gdx2d.lib.GdxGraphics; +import Text.TextEnemy; public class Enemy extends Character{ private String map; diff --git a/src/Main/PokeMudry.java b/src/Main/PokeMudry.java index f1ad4e3..ae3b330 100644 --- a/src/Main/PokeMudry.java +++ b/src/Main/PokeMudry.java @@ -2,16 +2,14 @@ package Main; import java.util.Vector; + import com.badlogic.gdx.Input; + import Control.Controller; import Entity.Enemy; import Entity.Entity; -import Entity.Player; -import Screen.ScreenMap; import Screen.ScreenPlayer; import ch.hevs.gdx2d.desktop.PortableApplication; -import ch.hevs.gdx2d.lib.GdxGraphics;import Screen.ScreenPlayer; -import ch.hevs.gdx2d.desktop.PortableApplication; import ch.hevs.gdx2d.lib.GdxGraphics; public class PokeMudry extends PortableApplication { diff --git a/src/PokeMudry.java b/src/PokeMudry.java deleted file mode 100644 index c7326df..0000000 --- a/src/PokeMudry.java +++ /dev/null @@ -1,99 +0,0 @@ -import java.util.Vector; - -import com.badlogic.gdx.Input; - -import Control.Controller; -import Entity.Enemy; -import Entity.Entity; -import Entity.Player; -import Screen.ScreenMap; -import Screen.ScreenPlayer; -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<>(); - - - public static void main(String[] args) { - new PokeMudry(); - } - - PokeMudry(){ - super(1000, 800); - controller = new Controller(); - sp = new ScreenPlayer(); - } - - public static Vector getEnemies() { - return enemies; - } - - @Override - public void onInit() { - sp.init(); - 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")); - - for (Enemy enemy : enemies) { - entities.add(enemy); - } - - for (Entity entity : entities) { - entity.init(); - } - } - - @Override - public void onGraphicRender(GdxGraphics g) { - g.clear(); - sp.p.manageEntity(sp.sm, controller); - sp.render(g); - for (Entity entity : entities) { - entity.graphicRender(g); - } - } - - - //key gestion - @Override - public void onKeyDown(int keycode) { - super.onKeyDown(keycode); - - switch (keycode) { - 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; - } - return; - - default: - break; - } - controller.keyStatus.put(keycode, true); - sp.screenManager.getActiveScreen().onKeyUp(keycode); - } - @Override - public void onKeyUp(int keycode) { - super.onKeyUp(keycode); - controller.keyStatus.put(keycode, false); - sp.screenManager.getActiveScreen().onKeyDown(keycode); - } -} diff --git a/src/testYann.java b/src/testYann.java index e42ef40..9ea062c 100644 --- a/src/testYann.java +++ b/src/testYann.java @@ -1,13 +1,10 @@ -import java.util.TreeMap; import java.util.Map; - -import com.badlogic.gdx.Input; +import java.util.TreeMap; import Control.Controller; import Entity.Enemy; import Screen.ScreenBattle; - import ch.hevs.gdx2d.desktop.PortableApplication; import ch.hevs.gdx2d.lib.GdxGraphics; import ch.hevs.gdx2d.lib.ScreenManager;