mirror of
https://github.com/Klagarge/PokeHES.git
synced 2024-11-23 09:53:28 +00:00
commit
fee27ebbab
@ -8,13 +8,13 @@ public class Enemy extends Character{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Enemy(String name, int x, int y, String img, String map, int pv, String branch) {
|
public Enemy(String name, int x, int y, String img, String map, int pv, String branch, Character.Direction dir) {
|
||||||
super(name, x, y, img, map);
|
super(name, x, y, img, map);
|
||||||
//generate his text
|
//generate his text
|
||||||
|
|
||||||
this.map = map;
|
this.map = map;
|
||||||
|
|
||||||
turn(Character.Direction.DOWN);
|
turn(dir);
|
||||||
|
|
||||||
this.branch = branch;
|
this.branch = branch;
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import com.badlogic.gdx.Input;
|
|||||||
import Control.Controller;
|
import Control.Controller;
|
||||||
import Entity.Enemy;
|
import Entity.Enemy;
|
||||||
import Entity.Entity;
|
import Entity.Entity;
|
||||||
|
import Entity.Character.Direction;
|
||||||
import Game.Battle;
|
import Game.Battle;
|
||||||
import Screen.ScreenBattle;
|
import Screen.ScreenBattle;
|
||||||
import Screen.ScreenMap;
|
import Screen.ScreenMap;
|
||||||
@ -45,8 +46,12 @@ public class PokeMudry extends PortableApplication {
|
|||||||
|
|
||||||
// add player, create and add all enemies in entities
|
// add player, create and add all enemies in entities
|
||||||
entities.add((Entity) sp.p);
|
entities.add((Entity) sp.p);
|
||||||
enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 25, "informatique"));
|
enemies.add(new Enemy("Mudry", 5, 11, "lumberjack_sheet32", "21N304", 25, "informatique", Direction.DOWN));
|
||||||
enemies.add(new Enemy("Mudry", 5, 11, "lumberjack_sheet32", "21N304", 25, "informatique"));
|
enemies.add(new Enemy("Paciotti", 5, 11, "lumberjack_sheet32", "21N205", 0, "mecanique", Direction.DOWN));
|
||||||
|
enemies.add(new Enemy("Gloeckner", 1, 7, "lumberjack_sheet32", "21N307", 0, "allemand", Direction.RIGHT));
|
||||||
|
enemies.add(new Enemy("Bianchi", 1, 3, "lumberjack_sheet32", "23N308", 0, "electricite", Direction.RIGHT));
|
||||||
|
enemies.add(new Enemy("Nicollier", 4, 2, "lumberjack_sheet32", "21N308", 0, "mathematique", Direction.LEFT));
|
||||||
|
enemies.add(new Enemy("Ellert", 1, 4, "lumberjack_sheet32", "23N215", 0, "physique", Direction.RIGHT));
|
||||||
|
|
||||||
for (Enemy enemy : enemies) { entities.add(enemy); }
|
for (Enemy enemy : enemies) { entities.add(enemy); }
|
||||||
|
|
||||||
@ -65,11 +70,15 @@ public class PokeMudry extends PortableApplication {
|
|||||||
// Switch screen
|
// Switch screen
|
||||||
if (sp.p.onEnemy && onMapScreen){
|
if (sp.p.onEnemy && onMapScreen){
|
||||||
sp.e = sp.p.lastEnemy;
|
sp.e = sp.p.lastEnemy;
|
||||||
sp.sb = sp.screenManager.getScreenBattle();
|
int pv = sp.e.getPv();
|
||||||
if(sp.e == null) System.out.println("sdfsdfsdfsdf");
|
|
||||||
|
|
||||||
|
if (pv>0) {
|
||||||
|
sp.sb = sp.screenManager.getScreenBattle();
|
||||||
sp.b = new Battle(sp.e);
|
sp.b = new Battle(sp.e);
|
||||||
g.resetCamera();
|
g.resetCamera();
|
||||||
|
} else {
|
||||||
|
sp.p.onEnemy = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(onBattleScreen) sp.sb.manage(controller, sp.b);
|
if(onBattleScreen) sp.sb.manage(controller, sp.b);
|
||||||
|
@ -2,6 +2,7 @@ package Screen;
|
|||||||
|
|
||||||
import Entity.Enemy;
|
import Entity.Enemy;
|
||||||
import Entity.Player;
|
import Entity.Player;
|
||||||
|
import Entity.Character.Direction;
|
||||||
import Game.Battle;
|
import Game.Battle;
|
||||||
import ch.hevs.gdx2d.lib.GdxGraphics;
|
import ch.hevs.gdx2d.lib.GdxGraphics;
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ public class ScreenPlayer {
|
|||||||
//p = new Player(8, 15, "desert");
|
//p = new Player(8, 15, "desert");
|
||||||
p = new Player(4, 2, "21RI");
|
p = new Player(4, 2, "21RI");
|
||||||
|
|
||||||
b = new Battle(new Enemy("enemi", 0, 0, "lumberjack_sheet32", "desert", 50, "enemi"));
|
b = new Battle(new Enemy("enemy", 0, 0, "lumberjack_sheet32", "desert", 50, "enemy",Direction.NULL));
|
||||||
|
|
||||||
// Create both type of screen and record for reuse
|
// Create both type of screen and record for reuse
|
||||||
screenManager.registerScreen(ScreenMap.class);
|
screenManager.registerScreen(ScreenMap.class);
|
||||||
|
@ -3,6 +3,7 @@ package Text;
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import Entity.Enemy;
|
import Entity.Enemy;
|
||||||
|
import Entity.Character.Direction;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@ -20,7 +21,7 @@ public class TextEnemy {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
TextEnemy t = new TextEnemy(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 25, "informatique"));
|
TextEnemy t = new TextEnemy(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 25, "informatique",Direction.NULL));
|
||||||
|
|
||||||
t.generateText();
|
t.generateText();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user