Ejemplo n.º 1
0
        public void InitializeEnvironment()
        {
            Camera.SetCameraWindow(Vector2.Zero, 300);
            mOffsetCounter      = -20;
            mTheFloorSet        = new List <Platform>();
            mTheSeaweedTallSet  = new List <Platform>();
            mTheSeaweedSmallSet = new List <Platform>();

            mEnemies = new PatrolEnemySet();

            for (int i = 0; i < kSectionSize / kFloorAndRoofSize; i++)
            {
                mOffsetCounter += kFloorAndRoofSize;
                mTheFloorSet.Add(new Platform("GROUND_1", new Vector2(mOffsetCounter, 20), new Vector2(kFloorAndRoofSize, kFloorAndRoofSize)));
            }

            mTheSign = new Platform("SIGN_1", new Vector2(kInitialSignPosX, kFloorAndRoofSize / 2 + kSignSize / 2), new Vector2(kSignSize, kSignSize));

            float randNum;

            for (int i = 0; i < 5; i++)
            {
                randNum = (float)Game1.sRan.NextDouble() * mTheFloorSet[mTheFloorSet.Count - 1].PositionX + kInitialSignPosX * 2;
                mTheSeaweedTallSet.Add(new Platform("SEAWEEDTALL_1", new Vector2(randNum, kFloorAndRoofSize), new Vector2(kFloorAndRoofSize / 1.5f, kFloorAndRoofSize * 1.5f)));
            }

            for (int i = 0; i < 5; i++)
            {
                randNum = (float)Game1.sRan.NextDouble() * mTheFloorSet[mTheFloorSet.Count - 1].PositionX;
                mTheSeaweedSmallSet.Add(new Platform("SEAWEEDSMALL_1", new Vector2(randNum, kFloorAndRoofSize / 2 - 5), new Vector2(kFloorAndRoofSize / 2, kFloorAndRoofSize / 2)));
            }

            mFishFood = new FishFood();
        }
Ejemplo n.º 2
0
 public GameState()
 {
     mEnemies = new PatrolEnemySet();
     mHero    = new PlayerControlHero(new Vector2(5, 5));
 }