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()));
        }
Exemple #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();
        }
Exemple #3
0
        public void GeneratePrison(Vector2 position, GameData data)
        {
            const float doorSize = 96;
            const float doorAscent = 64;
            const float prisonWidth = 576;
            const float prisonHeight = 576;
            const float halfWidth = prisonWidth / 2;
            const float halfHeight = prisonHeight / 2;
            const float wallWidth = 16;
            const float wallHalfWidth = wallWidth / 2;

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

            const float cellSize = prisonWidth / 3;
            const float cellDoorSize = 96;
            float internalWallHeight = position.Y + halfHeight - cellSize - wallHalfWidth;
            float internalWallSize = cellSize - cellDoorSize;

            //floor
            EntList.Add(new BldgFloor(position, new Vector2(prisonWidth, prisonHeight)));

            //solid walls
            EntList.Add(new BldgWall(position + new Vector2(0, halfHeight + wallHalfWidth), new Vector2(prisonWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position - new Vector2(0, halfHeight + wallHalfWidth), new Vector2(prisonWidth + 2 * wallWidth, wallWidth), 0));
            EntList.Add(new BldgWall(position + new Vector2(halfWidth + wallHalfWidth, 0), new Vector2(prisonHeight, 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));

            //internal walls
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + cellDoorSize + (internalWallSize / 2), internalWallHeight), new Vector2(cellSize - cellDoorSize, wallWidth), 0));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + cellSize + cellDoorSize + (internalWallSize / 2), internalWallHeight), new Vector2(cellSize - cellDoorSize, wallWidth), 0));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + 2 * cellSize + cellDoorSize + (internalWallSize / 2), internalWallHeight), new Vector2(cellSize - cellDoorSize, wallWidth), 0));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + cellSize - wallHalfWidth, internalWallHeight + (cellSize / 2) + wallHalfWidth), new Vector2(cellSize, wallWidth), 3 * MathHelper.PiOver2));
            EntList.Add(new BldgWall(new Vector2(position.X - halfWidth + 2 * cellSize - wallHalfWidth, internalWallHeight + (cellSize / 2) + wallHalfWidth), new Vector2(cellSize, wallWidth), 3 * MathHelper.PiOver2));

            //key
            if (!data.PrisonKeyFound)
            {
                DoorKey prisonKey = new DoorKey(position + new Vector2(halfWidth, -halfHeight) - new Vector2(32, -32), "prison door key");
                PickupTriggers.Add(new TriggerPickup(prisonKey.Position, new Vector2(64, 64), prisonKey));
                EntList.Add(prisonKey);
            }

            Note n = new Note(position - new Vector2(halfWidth, halfHeight) + new Vector2(64, 64));
            EntList.Add(n);
            ReadingTriggers.Add(new TriggerReading(n.Position, new Vector2(64, 64), Notes.PrisonNote));

            //doors
            Door prisonDoor = new Door(new Vector2(position.X - halfWidth + (cellDoorSize / 2), internalWallHeight), 0, "prison door");
            if (!data.PrisonDoorOpened)
            {
                EntList.Add(prisonDoor);
            }
            else
                prisonDoor.Unload();
            EntList.Add(new Door(new Vector2(position.X - halfWidth + cellSize + (cellDoorSize / 2), internalWallHeight), 0));
            EntList.Add(new Door(new Vector2(position.X - halfWidth + cellSize * 2 + (cellDoorSize / 2), internalWallHeight), 0));

            DoorOpenTriggers.Add(new TriggerDoorOpen(prisonDoor.Position, new Vector2(96, 96), prisonDoor, "prison door key"));

            //fuse
            if (!data.FuseFound)
            {
                Fuse f = new Fuse(new Vector2(position.X - halfWidth + (cellSize / 2), internalWallHeight + (cellSize / 2)));
                EntList.Add(f);
                PickupTriggers.Add(new TriggerPickup(f.Position, new Vector2(64, 64), f));
            }
        }