Exemplo n.º 1
0
        public Background(ZeldaGame game, int roomNumber)
        {
            this.roomNumber = roomNumber;
            this.game       = game;
            RoomTextureStorage roomTextures = new RoomTextureStorage(this.game);

            game.spriteSheets.TryGetValue("DungeonTileset", out itemSpriteSheet);

            windowWidth  = game.GraphicsDevice.Viewport.Width;
            windowHeight = game.GraphicsDevice.Viewport.Height;

            int windowHeightFloor = ((windowHeight / ParserUtility.SCALE_FACTOR - ParserUtility.WINDOW_X_ADJUST / ParserUtility.SCALE_FACTOR) / ParserUtility.GEN_ADJUST) + ParserUtility.GAME_FRAME_ADJUST;
            int windowWidthFloor  = (windowWidth / ParserUtility.SCALE_FACTOR - ParserUtility.WINDOW_Y_ADJUST / ParserUtility.SCALE_FACTOR) / ParserUtility.GEN_ADJUST;

            drawLocationInterior = new Vector2(windowWidthFloor + storage.drawOffset, windowHeightFloor + storage.drawOffset);
            drawLocationExterior = new Vector2(windowWidthFloor, windowHeightFloor);

            roominterior = roomTextures.getRoom(roomNumber);
            if (roomNumber == storage.specialRoomNumber)
            {
                roomexterior = new UniversalSprite(game, itemSpriteSheet, storage.ROOM_RECTANGLE, Color.White, SpriteEffects.None, Vector2.One, storage.roomLimiter, storage.LAYERDEPTH);
                roominterior = new UniversalSprite(game, itemSpriteSheet, storage.ROOM_RECTANGLE, Color.Transparent, SpriteEffects.None, Vector2.One, storage.roomLimiter, storage.LAYERDEPTH);
            }
            else
            {
                roomexterior = new UniversalSprite(game, itemSpriteSheet, storage.ROOM_EXTERIOR_RECTANGLE, Color.White, SpriteEffects.None, Vector2.One, storage.roomLimiter, storage.LAYERDEPTH);
            }
        }
Exemplo n.º 2
0
        public TopDoor(ZeldaGame game, RoomTextureStorage textures, int doorValue)
        {
            this.game      = game;
            windowWidth    = game.GraphicsDevice.Viewport.Width;
            windowHeight   = game.GraphicsDevice.Viewport.Height;
            this.doorValue = doorValue;

            int windowHeightFloor = ((windowHeight / ParserUtility.SCALE_FACTOR - ParserUtility.WINDOW_X_ADJUST / ParserUtility.SCALE_FACTOR) / ParserUtility.GEN_ADJUST) + ParserUtility.GAME_FRAME_ADJUST;
            int windowWidthFloor  = (windowWidth / ParserUtility.SCALE_FACTOR - ParserUtility.WINDOW_Y_ADJUST / ParserUtility.SCALE_FACTOR) / ParserUtility.GEN_ADJUST;

            windowWidthFloor = windowWidthFloor + DoorUtility.topDoorAdjust * ParserUtility.SCALE_FACTOR;

            this.position       = new Vector2(windowWidthFloor, windowHeightFloor);
            this.topDoorTexture = textures;
            this.topDoorSprite  = this.topDoorTexture.getDoor(doorValue);
        }