mirror of
				https://github.com/Klagarge/PokeHES.git
				synced 2025-10-31 03:39:16 +00:00 
			
		
		
		
	| @@ -1,10 +1,8 @@ | |||||||
| package Entity; | package Entity; | ||||||
|  |  | ||||||
| import Text.TextEnemy; |  | ||||||
|  |  | ||||||
| import com.badlogic.gdx.math.Vector2; | import com.badlogic.gdx.math.Vector2; | ||||||
|  |  | ||||||
| import ch.hevs.gdx2d.lib.GdxGraphics; | import Text.TextEnemy; | ||||||
|  |  | ||||||
| public class Enemy extends Character{ | public class Enemy extends Character{ | ||||||
|     private String map; |     private String map; | ||||||
| @@ -14,13 +12,13 @@ public class Enemy extends Character{ | |||||||
|     public Enemy(String name, int x, int y, String img, String map) { |     public Enemy(String name, int x, int y, String img, String map) { | ||||||
|         super(name, x, y, img); |         super(name, x, y, img); | ||||||
|         //generate his text |         //generate his text | ||||||
|         this.textEnemy = new TextEnemy(name); |         this.textEnemy = new TextEnemy("enemi"); //TODO should be name | ||||||
|         textEnemy.generateText(); |         textEnemy.generateText(); | ||||||
|         this.map = map; |         this.map = map; | ||||||
|  |  | ||||||
|         turn(Character.Direction.DOWN); |         turn(Character.Direction.DOWN); | ||||||
|         //generate the vector of fight |         //generate the vector of fight | ||||||
|         fightData = new FightData(name); |         //FightData fightData = new FightData(name); | ||||||
|  |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,12 +1,32 @@ | |||||||
| package Main; | package Main; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | import java.util.Vector; | ||||||
|  |  | ||||||
|  | import com.badlogic.gdx.Input; | ||||||
|  |  | ||||||
|  | import Control.Controller; | ||||||
|  | import Entity.Enemy; | ||||||
|  | import Entity.Entity; | ||||||
| import Screen.ScreenPlayer; | import Screen.ScreenPlayer; | ||||||
| import ch.hevs.gdx2d.desktop.PortableApplication; | import ch.hevs.gdx2d.desktop.PortableApplication; | ||||||
| import ch.hevs.gdx2d.lib.GdxGraphics; | import ch.hevs.gdx2d.lib.GdxGraphics; | ||||||
|  |  | ||||||
| public class PokeMudry extends PortableApplication { | public class PokeMudry extends PortableApplication { | ||||||
|      |      | ||||||
|     private ScreenPlayer screenPlayer = new ScreenPlayer(); |     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) { |     public static void main(String[] args) { | ||||||
|         new PokeMudry(); |         new PokeMudry(); | ||||||
| @@ -14,29 +34,68 @@ public class PokeMudry extends PortableApplication { | |||||||
|  |  | ||||||
|     PokeMudry(){ |     PokeMudry(){ | ||||||
|         super(Settings.SIDE, Settings.SIDE); |         super(Settings.SIDE, Settings.SIDE); | ||||||
|  |         controller = new Controller(); | ||||||
|  |         sp = new ScreenPlayer(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public static Vector<Enemy> getEnemies() { | ||||||
|  | 		return enemies; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public void onInit() { |     public void onInit() { | ||||||
|         screenPlayer.init(); |         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 |     @Override | ||||||
|     public void onGraphicRender(GdxGraphics g) { |     public void onGraphicRender(GdxGraphics g) { | ||||||
|         screenPlayer.render(g); |         g.clear(); | ||||||
|  | 		sp.p.manageEntity(sp.sm, controller); | ||||||
|  |         sp.render(g); | ||||||
|  | 		for (Entity entity : entities) { | ||||||
|  | 			entity.graphicRender(g); | ||||||
|  | 		} | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     //key gestion |     //key gestion | ||||||
|     @Override |     @Override | ||||||
|     public void onKeyDown(int keycode) { |     public void onKeyDown(int keycode) { | ||||||
|         screenPlayer.screenManager.getActiveScreen().onKeyDown(keycode); |  | ||||||
|         super.onKeyDown(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 |     @Override | ||||||
|     public void onKeyUp(int keycode) { |     public void onKeyUp(int keycode) { | ||||||
|         screenPlayer.screenManager.getActiveScreen().onKeyUp(keycode); |  | ||||||
|         super.onKeyUp(keycode); |         super.onKeyUp(keycode); | ||||||
|  |         controller.keyStatus.put(keycode, false); | ||||||
|  |         sp.screenManager.getActiveScreen().onKeyDown(keycode); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @@ -22,7 +22,7 @@ public class FightData { | |||||||
|     */ |     */ | ||||||
|  |  | ||||||
|     public FightData(String name) { |     public FightData(String name) { | ||||||
|         file = new File("resources//fight//" + name + ".csv"); |         file = new File("./resources/Battle/Fight/" + name + ".csv"); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void readFile() { |     public void readFile() { | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ public class SpeechData { | |||||||
|      |      | ||||||
|  |  | ||||||
|     public SpeechData(String name){ |     public SpeechData(String name){ | ||||||
|         file = new File("resources//fight//" + name + ".csv"); |         file = new File("./resources/Battle/Fight/" + name + ".csv"); | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     public void readFile() { |     public void readFile() { | ||||||
| @@ -24,7 +24,7 @@ public class SpeechData { | |||||||
|             line = bf.readLine();  |             line = bf.readLine();  | ||||||
|             while(line != null){ |             while(line != null){ | ||||||
|                  |                  | ||||||
|                 Speechs.add(line); |                 speechs.add(line); | ||||||
|  |  | ||||||
|                 line = bf.readLine(); |                 line = bf.readLine(); | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -1,13 +1,10 @@ | |||||||
|  |  | ||||||
| import java.util.TreeMap; |  | ||||||
| import java.util.Map; | import java.util.Map; | ||||||
|  | import java.util.TreeMap; | ||||||
| import com.badlogic.gdx.Input; |  | ||||||
|  |  | ||||||
| import Control.Controller; | import Control.Controller; | ||||||
| import Entity.Enemy; | import Entity.Enemy; | ||||||
| import Screen.ScreenBattle; | import Screen.ScreenBattle; | ||||||
|  |  | ||||||
| import ch.hevs.gdx2d.desktop.PortableApplication; | import ch.hevs.gdx2d.desktop.PortableApplication; | ||||||
| import ch.hevs.gdx2d.lib.GdxGraphics; | import ch.hevs.gdx2d.lib.GdxGraphics; | ||||||
| import ch.hevs.gdx2d.lib.ScreenManager; | import ch.hevs.gdx2d.lib.ScreenManager; | ||||||
| @@ -32,7 +29,7 @@ public class testYann extends PortableApplication{ | |||||||
|     public void onInit() { |     public void onInit() { | ||||||
|          |          | ||||||
|         s.registerScreen(ScreenBattle.class); |         s.registerScreen(ScreenBattle.class); | ||||||
|         Enemy e = new Enemy("enemi", 50, 50, "resources//lumberjack_sheet32.png"); |         Enemy e = new Enemy("enemi", 50, 50, "resources//lumberjack_sheet32.png", "desert"); | ||||||
|          |          | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user