mirror of
				https://github.com/Klagarge/PokeHES.git
				synced 2025-11-04 13:19:17 +00:00 
			
		
		
		
	done
This commit is contained in:
		@@ -7,11 +7,13 @@ import com.badlogic.gdx.math.Vector2;
 | 
			
		||||
import ch.hevs.gdx2d.lib.GdxGraphics;
 | 
			
		||||
 | 
			
		||||
public class Enemy extends Character{
 | 
			
		||||
    private String map;
 | 
			
		||||
 | 
			
		||||
    public FightData fightData;
 | 
			
		||||
 | 
			
		||||
    public Enemy(String name, int x, int y, String img) {
 | 
			
		||||
    public Enemy(String name, int x, int y, String img, String map) {
 | 
			
		||||
        super(name, x, y, img);
 | 
			
		||||
        this.map = map;
 | 
			
		||||
 | 
			
		||||
        turn(Character.Direction.DOWN);
 | 
			
		||||
        //generate the vector of fight
 | 
			
		||||
@@ -20,12 +22,17 @@ public class Enemy extends Character{
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPosition(int x, int y){
 | 
			
		||||
 | 
			
		||||
    public String getMap() {
 | 
			
		||||
        return map;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPosition(Vector2 vPosition){
 | 
			
		||||
        setPosition((int)vPosition.x, (int)vPosition.y);
 | 
			
		||||
    public void setPosition(int x, int y, String map){
 | 
			
		||||
        position.set(x, y);
 | 
			
		||||
        this.map = map;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPosition(Vector2 vPosition, String map){
 | 
			
		||||
        setPosition((int)vPosition.x, (int)vPosition.y, map);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -46,13 +46,8 @@ public class Player extends Character{
 | 
			
		||||
 | 
			
		||||
			// Is the move valid ?
 | 
			
		||||
			if (sm.isWalkable(nextCell)) {
 | 
			
		||||
				if(!enemy()){
 | 
			
		||||
					// Go
 | 
			
		||||
					setSpeed(sm.getSpeed(nextCell));
 | 
			
		||||
					go(goalDirection);
 | 
			
		||||
				} else {
 | 
			
		||||
					
 | 
			
		||||
				}
 | 
			
		||||
				setSpeed(sm.getSpeed(nextCell));
 | 
			
		||||
				go(goalDirection);
 | 
			
		||||
			} else {
 | 
			
		||||
				// Face the wall
 | 
			
		||||
				turn(goalDirection);
 | 
			
		||||
@@ -78,12 +73,10 @@ public class Player extends Character{
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    private boolean enemy() {
 | 
			
		||||
		/*
 | 
			
		||||
		Vector<Entity> entities = testHER.getEntities;
 | 
			
		||||
		for (Entity entity : entities) {
 | 
			
		||||
		//Vector<Enemy> enemies = PokeMudry.getEnemies;
 | 
			
		||||
		//for (Enemy enemy : enemies) {
 | 
			
		||||
			
 | 
			
		||||
		}
 | 
			
		||||
		*/
 | 
			
		||||
		//}
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user