Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 public Spawn(Game game, Biome biome, Vector2 pos, bool defSpawn)
     : base(game)
 {
     spawnLocation = biome;
     position = pos;
     defaultSpawn = defSpawn;
     g = game;
 }
Exemplo n.º 3
0
 public void setCurrentBiome(Biome b)
 {
     currentBiome = b;
 }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
 // get/set methods
 public void setBiome(Biome b)
 {
     spawnLocation = b;
 }