public void changeMap(int id) { map.player = null; PokeEngine.instance.changeMap(MapProvider.getInstance().getMap(id)); map = MapProvider.getInstance().getMap(id); map.player = this; }
protected override void LoadContent() { base.LoadContent(); sbatch = new SpriteBatch(GraphicsDevice); Art.loadAssets(GraphicsDevice); MapProvider.getInstance().loadConnections(); map = MapProvider.getInstance().getMap(0); //new Map(this, 0); Font.initialize(GraphicsDevice); }
public Map(PokeEngine engine, int id) { this.engine = engine; this.mapid = id; entities = new List <Entity>(); initialize(id); if (!(this is MapConnection)) { if (MapProvider.getInstance().getConnections(id) != null) { foreach (ConnectionInfo info in MapProvider.getInstance().getConnections(id)) { if (info.dir == ConnectionDirection.LEFT) { connectionLeft = info.createConnectionFromInfo(this); } else if (info.dir == ConnectionDirection.UP) { connectionUp = info.createConnectionFromInfo(this); } else if (info.dir == ConnectionDirection.RIGHT) { connectionRight = info.createConnectionFromInfo(this); } else if (info.dir == ConnectionDirection.DOWN) { connectionDown = info.createConnectionFromInfo(this); } } } /*connectionLeft = new MapConnection(engine, this, ConnectionDirection.LEFT, 2, 0); * connectionUp = new MapConnection(engine, this, ConnectionDirection.UP, 2, 0); * connectionRight = new MapConnection(engine, this, ConnectionDirection.RIGHT, 2, 1); * connectionDown = new MapConnection(engine, this, ConnectionDirection.DOWN, 2, 0);*/ } }