Пример #1
0
        public void Initialize(OpenTK.GameWindow window)
        {
            Window = window;
            //window.ClientSize = new Size(room1Layout[0].Length * tileSize, room1Layout.Length * tileSize);
            Window.ClientSize = new Size(8 * tileSize, 6 * tileSize);
            projectiles = new List<Bullet>();
            TextureManager.Instance.UseNearestFiltering = true;

            hero = new PlayerCharacter(heroSheet, new Point(spawnTile.X * tileSize, spawnTile.Y * tileSize));
            room1 = new Map(room1Layout, spriteSheets, spriteSources, 2, 0);
            room2 = new Map(room2Layout, spriteSheets, spriteSources, 0, 2);
            room1[4][13].MakeDoor(room2, new Point(1, 1));
            room2[1][0].MakeDoor(room1, new Point(12, 4));
            currentMap = room1;

            room1.AddEnemy(npcSheet, new Point(6 * tileSize, 1 * tileSize), true);
            room2.AddEnemy(npcSheet, new Point(1 * tileSize, 4 * tileSize), false);
            room1.AddItem(spriteSheets, new Rectangle(350, 255, 16, 16), 10, new Point(3 * tileSize + 7, 2 * tileSize + 7));
            room1.AddItem(spriteSheets, new Rectangle(381, 256, 13, 15), 20, new Point(5 * tileSize + 7, 4 * tileSize + 7));
            room2.AddItem(spriteSheets, new Rectangle(412, 256, 16, 15), 30, new Point(4 * tileSize + 7, 2 * tileSize + 7));
        }