private void SetPlayerPosition(LayeredWorld world) { int playerX = int.Parse(lines[StringHelper.GetSymbolIndex("player_x:", lines)].Split(':')[1]); int playerY = int.Parse(lines[StringHelper.GetSymbolIndex("player_y:", lines)].Split(':')[1]); world.PlayerStartPosition = new Vector2D(playerX, playerY); }
private LayeredWorld GetWorld() { LayeredWorld world = new LayeredWorld(width, height); foreach (Tile[] layer in layers) { world.AddLayer(layer); } return(world); }
public void Initialize() { world = (LayeredWorld)WorldManager.Worlds["first_world"]; view = new View(new Vector2f(100, 0), new Vector2f(50, 50)); view.Zoom(10); player = new Player(world.PlayerStartPosition); Program.RenderWindow.KeyPressed += RenderWindow_KeyPressed; }
private LayeredWorld CreateWorld() { GetLayers(); LayeredWorld world = GetWorld(); SetPlayerPosition(world); if (teleportationIndex != -1) { SetWorldTeleporters(world); } return(world); }
private void SetWorldTeleporters(LayeredWorld world) { int x; int y; string target; string texture; string[] parts; for (int i = teleportationIndex + 1; i < lines.Length; i++) { parts = lines[i].Split(':', ','); texture = parts[0]; x = int.Parse(parts[1]); y = int.Parse(parts[2]); target = parts[3]; Teleporter teleporter = new Teleporter(new Vector2D(x, y), target, texture); world.AddTeleporter(teleporter); } }
public void Initialize() { world = (LayeredWorld)WorldManager.GetWorld("grassland"); player = new SecondPlayer(world); }
private LayeredWorld GetWorld() { LayeredWorld world = new LayeredWorld(width, height); foreach (Tile[] layer in layers) world.AddLayer(layer); return world; }