package ei.game.scene; import ei.engine.math.Vector2f; import ei.engine.math.Vector2i; import ei.engine.math.Vector3f; import ei.engine.scene.Node; import ei.engine.scene.Sprite; import ei.game.player.GaiaPlayer; import ei.game.player.Player; import ei.game.player.PlayerHandler; import ei.game.scene.map.Stone; public class Map { private static final int POS_SIZE = 50; private int width; private int hight; private GameEntity[][] map; private Node mapNode; public Map(int w, int h){ this.width = w; this.hight = h; //init(); } public void init(){ map = new GameEntity[width][hight]; // init textures mapNode = new Node("MapNode"); for(int i=0; i= width || y >= hight) return false; return true; } /** * Returns the object at the pos * * @param x The x pos * @param y The y pos * @return The object in that pos */ public GameEntity getPos(int x, int y){ return map[x][y]; } /** * Sets an object at the pos * * @param e The object * @param x The x pos * @param y The y pos */ public void setPos(GameEntity e, int x, int y){ map[x][y] = e; } /** * Removes a object from that pos * * @param x The x pos * @param y The y pos */ public void removePos(int x, int y){ map[x][y] = null; } /** * Returns the map node * * @return The map node */ public Node getMapNode(){ return mapNode; } public Vector2i getPosIndex(GameEntity u){ for(int i=0; i