Exemplo n.º 1
0
        private void LoadRoom(Vector2 position, GameData data)
        {
            //floor
            EntList.Add(new BldgFloor(position, new Vector2(houseWidth, houseHeight)));

            //solid walls
            EntList.Add(new BldgWall(position + new Vector2(0, halfHeight + wallHalfWidth), new Vector2(houseWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position - new Vector2(0, halfHeight + wallHalfWidth), new Vector2(houseWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position - new Vector2(halfWidth + wallHalfWidth, 0), new Vector2(houseHeight, wallWidth), 3 * MathHelper.PiOver2));
            EntList.Add(new BldgWall(position + new Vector2(halfWidth + wallHalfWidth, 0), new Vector2(houseHeight, wallWidth), MathHelper.PiOver2));

            //switch
            if (!data.SwitchFound)
            {
                Switch s = new Switch(position + new Vector2(halfWidth - 32, halfHeight - 32));
                EntList.Add(s);
                PickupTriggers.Add(new TriggerPickup(s.Position, new Vector2(64, 64), s));
            }

            Note n = new Note(Vector2.Zero);

            EntList.Add(n);
            ReadingTriggers.Add(new TriggerReading(n.Position, new Vector2(64, 64), Notes.HouseNote));

            //stairs
            Stairs st = new Stairs(position - (new Vector2(halfWidth - stairsHalfWidth - 80, -halfHeight + stairsHalfHeight)));

            EntList.Add(st);
            EntList.Add(new Border(st.Position - new Vector2(0, st.Size.Y / 2 + 2), new Vector2(st.Size.X, 4)));
            EntList.Add(new Border(st.Position + new Vector2(st.Size.X / 2 + 2, 1), new Vector2(4, st.Size.Y + 2)));
            AreaChangeTriggers.Add(new TriggerChangeArea(st.Position, st.Size - new Vector2(10, 10), new AreaMars()));
        }
Exemplo n.º 2
0
        public override void LoadContent(GameData data)
        {
            EntList.Add(new SpaceshipInt(Vector2.Zero));
            Note n = new Note(new Vector2(-64, 40));

            EntList.Add(n);
            ReadingTriggers.Add(new TriggerReading(n.Position, new Vector2(64, 64), Notes.ShipNote));

            AreaChangeTriggers.Add(new TriggerChangeArea(new Vector2(0, 80), new Vector2(96, 48), new AreaMars()));

            EntList.Add(new Border(new Vector2(-128 - 16, 0), new Vector2(32, 256)));
            EntList.Add(new Border(new Vector2(128 + 16, 0), new Vector2(32, 256)));
            EntList.Add(new Border(new Vector2(0, -128 - 16), new Vector2(256, 32)));
            EntList.Add(new Border(new Vector2(0, 128 + 16), new Vector2(256, 32)));

            EntList.Add(new Border(new Vector2(-1, -96), new Vector2(88, 30)));


            if (data.CoreFound && data.FuseFound && data.SwitchFound)
            {
                EndgameTrigger.Add(new TriggerEndgame(new Vector2(0, 40), new Vector2(100, 100)));
            }

            Resources.StopAllAudio();
            Resources.Audio["shipStaticLoop.wav"].Play();
        }
Exemplo n.º 3
0
        public void GenerateHouse1(Vector2 position, GameData data)
        {
            const float doorSize      = 96;
            const float doorAscent    = 96;
            const float houseWidth    = 512;
            const float houseHeight   = 384;
            const float halfWidth     = houseWidth / 2;
            const float halfHeight    = houseHeight / 2;
            const float wallWidth     = 16;
            const float wallHalfWidth = wallWidth / 2;

            const float doorTopHeight         = doorSize + doorAscent;
            const float wallAboveDoorSize     = (houseHeight - (doorAscent + doorSize));
            const float halfWallAboveDoorSize = wallAboveDoorSize / 2;

            const float stairsWidth  = 96;
            const float stairsHeight = 64;

            const float stairsHalfWidth  = stairsWidth / 2;
            const float stairsHalfHeight = stairsHeight / 2;

            //floor
            EntList.Add(new BldgFloor(position, new Vector2(houseWidth, houseHeight)));

            //solid walls
            EntList.Add(new BldgWall(position + new Vector2(0, halfHeight + wallHalfWidth), new Vector2(houseWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position - new Vector2(0, halfHeight + wallHalfWidth), new Vector2(houseWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position - new Vector2(halfWidth + wallHalfWidth, 0), new Vector2(houseHeight, wallWidth), 3 * MathHelper.PiOver2));

            //wall w/ entrance
            EntList.Add(new BldgWall(position - new Vector2(-halfWidth - wallHalfWidth, halfHeight - (doorAscent / 2)), new Vector2(doorAscent, wallWidth), MathHelper.PiOver2));
            EntList.Add(new BldgWall(position - new Vector2(-halfWidth - wallHalfWidth, halfHeight - doorTopHeight - halfWallAboveDoorSize), new Vector2(wallAboveDoorSize, wallWidth), MathHelper.PiOver2));

            //stairs
            Stairs s = new Stairs(position - new Vector2(halfWidth - stairsHalfWidth, -halfHeight + stairsHalfHeight));

            EntList.Add(s);
            EntList.Add(new Border(s.Position - new Vector2(0, s.Size.Y / 2 + 2), new Vector2(s.Size.X, 4)));
            AreaChangeTriggers.Add(new TriggerChangeArea(s.Position, s.Size - new Vector2(10, 10), new AreaUpstairs()));
        }
Exemplo n.º 4
0
        public override void LoadContent(GameData data)
        {
            Random random = new Random();

            for (int i = 0; i < 150; i++)
            {
                EntList.Add(new Pebble(new Vector2((float)(random.NextDouble() * 3000) - 1500, (float)(random.NextDouble() * 3000) - 1500), (random.Next(0, 2) == 1) ? Resources.Textures["pebble1.png"] : Resources.Textures["pebble2.png"]));
            }

            //EntList.Add(new Rock(new Vector2(-100, 50), Resources.Textures["rock1.png"]));

            GeneratePrison(new Vector2(512, 512), data);
            GenerateHouse1(new Vector2(-768, 256), data);

            EntList.Add(new CaveStairs(new Vector2(-128, 768)));
            EntList.Add(new SpaceshipExt(new Vector2(-64, -400)));
            AreaChangeTriggers.Add(new TriggerChangeArea(new Vector2(-64, -200), new Vector2(96, 64), new AreaShip()));
            AreaChangeTriggers.Add(new TriggerChangeArea(new Vector2(-128, 768), new Vector2(64, 96), new AreaCave()));

            Resources.StopAllAudio();
            Resources.Audio["wind.wav"].Play();
        }
Exemplo n.º 5
0
        public override void LoadContent(GameData data)
        {
            //hall
            EntList.Add(new CaveFloor(new Vector2(0, -hallHeightHalf), new Vector2(hallWidth, hallHeight)));
            EntList.Add(new CaveWall(new Vector2(-hallWidthHalf - wallWidthHalf, -hallHeightHalf), new Vector2(hallHeight, wallWidth), MathHelper.PiOver2));
            EntList.Add(new CaveWall(new Vector2(hallWidthHalf + wallWidthHalf, -hallHeightHalf), new Vector2(hallHeight, wallWidth), 3 * MathHelper.PiOver2));
            AreaChangeTriggers.Add(new TriggerChangeArea(new Vector2(0, -hallHeight - hallWidthHalf), new Vector2(hallWidthHalf, hallWidthHalf), new AreaMars()));

            //room
            EntList.Add(new CaveFloor(new Vector2(0, roomHeightHalf), new Vector2(roomWidth, roomHeight)));
            EntList.Add(new CaveWall(new Vector2(0, roomHeight + wallWidthHalf), new Vector2(roomWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new CaveWall(new Vector2(-roomWidthHalf - wallWidthHalf, roomHeightHalf), new Vector2(roomHeight, wallWidth), MathHelper.PiOver2));
            EntList.Add(new CaveWall(new Vector2(roomWidthHalf + wallWidthHalf, roomHeightHalf), new Vector2(roomHeight, wallWidth), 3 * MathHelper.PiOver2));

            const float bottomWallSize = roomWidthHalf - hallWidthHalf;
            const float bottomWallX    = roomWidthHalf + wallWidth - (bottomWallSize / 2);

            const float midWallSize = roomWidthHalf - doorWidthHalf;
            const float midWallX    = roomWidthHalf - (midWallSize / 2);

            EntList.Add(new CaveWall(new Vector2(-bottomWallX, -wallWidthHalf), new Vector2(bottomWallSize, wallWidth), MathHelper.Pi));
            EntList.Add(new CaveWall(new Vector2(bottomWallX, -wallWidthHalf), new Vector2(bottomWallSize, wallWidth), MathHelper.Pi));
            EntList.Add(new CaveWall(new Vector2(-midWallX, roomHeightHalf), new Vector2(midWallSize, 3 * wallWidth), 0));
            EntList.Add(new CaveWall(new Vector2(midWallX, roomHeightHalf), new Vector2(midWallSize, 3 * wallWidth), 0));

            //doors
            Door d1 = new Door(new Vector2(0, roomHeightHalf - wallWidth), 0);
            Door d2 = new Door(new Vector2(0, roomHeightHalf), 0);
            Door d3 = new Door(new Vector2(0, roomHeightHalf + wallWidth), 0);

            d2.Visible = false;
            d2.Solid   = false;

            d3.Visible = false;
            d3.Solid   = false;

            EntList.Add(d1);
            EntList.Add(d2);
            EntList.Add(d3);

            Button b1 = new Button(new Vector2(-roomWidthHalf + 8 + 32, 19 + 32));
            Button b2 = new Button(b1.Position + new Vector2(0, 64 + 19));
            Button b3 = new Button(b2.Position + new Vector2(0, 64 + 19));
            Button b4 = new Button(new Vector2(-b3.Position.X, b3.Position.Y));

            EntList.Add(b1);
            EntList.Add(b2);
            EntList.Add(b3);
            EntList.Add(b4);

            TriggerButtonPress bp1 = new TriggerButtonPress(b1.Position, b1.Size, b1, d2, d3);
            TriggerButtonPress bp2 = new TriggerButtonPress(b2.Position, b2.Size, b2, d1, d2);
            TriggerButtonPress bp3 = new TriggerButtonPress(b3.Position, b3.Size, b3, d1, d3);
            TriggerButtonPress bp4 = new TriggerButtonPress(b4.Position, b4.Size, b4, d1, d2, d3);

            ButtonPressTriggers.Add(bp1);
            ButtonPressTriggers.Add(bp2);
            ButtonPressTriggers.Add(bp3);
            ButtonPressTriggers.Add(bp4);

            if (!data.CoreFound)
            {
                ShipCore core = new ShipCore(new Vector2(0, roomHeight - 96));
                PickupTriggers.Add(new TriggerPickup(core.Position, core.Size + new Vector2(16, 16), core));
                EntList.Add(core);
            }

            Note n = new Note(new Vector2(-b1.Position.X, b1.Position.Y));

            EntList.Add(n);
            ReadingTriggers.Add(new TriggerReading(n.Position, new Vector2(64, 64), Notes.CaveNote));

            Resources.StopAllAudio();
            Resources.Audio["shipStaticLoop.wav"].Play();
        }