public Layer(ContentManager Content, String file, float scrollSpeed, Biome o) { // Assumes each layer only has 3 segments. texture = Content.Load<Texture2D>(file); owner = o; scrollRate = scrollSpeed; }
public Spawn(Game game, Biome biome, Vector2 pos, bool defSpawn) : base(game) { spawnLocation = biome; position = pos; defaultSpawn = defSpawn; g = game; }
public void setCurrentBiome(Biome b) { currentBiome = b; }
public void loadPlayerFile() { String[] temp; char[] delim = new char[2]; delim[0] = ','; StreamReader sr = new StreamReader("../../../../Evolution GameContent/world data/player data/player_" + id + ".plr"); temp = sr.ReadLine().Split(delim); id = Convert.ToInt32(temp[0]); temp = sr.ReadLine().Split(delim); health = Convert.ToInt32(temp[0]); mana = Convert.ToInt32(temp[1]); temp = sr.ReadLine().Split(delim); if (temp[0] == "-1") { items = null; } else { for (int i = 0; i < temp.Length; i++) { items.addItem(Convert.ToInt32(temp[i])); } } temp = sr.ReadLine().Split(delim); spawn.setPosition(new Vector2(Convert.ToInt32(temp[0]), Convert.ToInt32(temp[1]))); position = spawn.getPosition(); // players position begins at default spawn when a level is loaded temp = sr.ReadLine().Split(delim); currentBiome = new Biome(game, (Biome.nameId)Convert.ToInt32(temp[0]), (Biome.typeId)Convert.ToInt32(temp[1]), new Vector2(Convert.ToInt32(temp[2]), Convert.ToInt32(temp[3])), Convert.ToInt32(temp[4]), Convert.ToInt32(temp[5]), new Vector2(Convert.ToInt32(temp[6]), Convert.ToInt32(temp[7])), true); spawn.setBiome(currentBiome); // spawn biome and current biome are the same when the game is loaded sr.Close(); }
// get/set methods public void setBiome(Biome b) { spawnLocation = b; }