1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-26 19:13:27 +00:00

poslish of polish

This commit is contained in:
Rémi Heredero 2022-06-09 19:20:43 +02:00
parent 419c8ed93f
commit 876cc9192e
4 changed files with 4 additions and 111 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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<Enemy> enemies = new Vector<>();
private static Vector<Entity> entities = new Vector<>();
public static void main(String[] args) {
new PokeMudry();
}
PokeMudry(){
super(1000, 800);
controller = new Controller();
sp = new ScreenPlayer();
}
public static Vector<Enemy> 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);
}
}

View File

@ -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;