Esempio n. 1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            //using (Game1 game = new Game1())
            //{
            //    game.Run();
            //}

            using (Game1 game = new Game1())
            {
                game.Run();
            }
        }
Esempio n. 2
0
        public static void Start(Game1 injectedGame)
        {
            game = injectedGame;
            hero = new HeroClasses.Warrior();
            GenerateLevel();

            windowSizeInTiles = new IntVec(game.Width / CELLWIDTH, game.Height / CELLWIDTH);
            cameraPosition = currentLevel.CharacterEntities.FindPosition(hero);
            modifiedCameraPosition.X = cameraPosition.X - (windowSizeInTiles.X / 2);
            modifiedCameraPosition.Y = cameraPosition.Y - (windowSizeInTiles.Y / 2);

            LogPosition = new Vector2(12, 12);
            // = new Vector2(game.Width - 48, game.Height - 48);
            InventoryPosition = new Vector2(game.Width - 5 * (CELLWIDTH), game.Height - 4 * (CELLWIDTH));
            InvButtonPosition = new Vector2(game.Width - CELLWIDTH, game.Height - CELLWIDTH);
            abilityPosition = new Vector2(game.Width / 2, game.Height - CELLWIDTH);
            charSheetPosition = new Vector2(0, 60);
            InventorySize = new Vector2(4 * CELLWIDTH, 4 * CELLWIDTH);
            weaponEquipPosition = new Vector2(0, game.Height - 2 * CELLWIDTH - 20);
            armorEquipPosition = new Vector2(0, game.Height - CELLWIDTH);
            game.IsMouseVisible = true;

            LoadMainMenu();

            saveButton = new UIButton(new Vector2(game.Width / 2 - 150, game.Height / 2), true, "UI/Save", "Save and quit");
            continueButton = new UIButton(new Vector2(game.Width / 2 + 150, game.Height / 2), true, "UI/Continue", "Continue");

            headSlot = new UIButton(armorEquipPosition, false, "UI/HelmOverlay", "Helm");
            chestSlot = new UIButton(new Vector2(armorEquipPosition.X + CELLWIDTH, armorEquipPosition.Y),
                false, "UI/ChestOverlay", "Chest");
            legSlot = new UIButton(new Vector2(armorEquipPosition.X + 2 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/LegsOverlay", "Legs");
            ringSlot1 = new UIButton(new Vector2(armorEquipPosition.X + 3 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/RingOverlay", "Ring");
            ringSlot2 = new UIButton(new Vector2(armorEquipPosition.X + 4 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/RingOverlay", "Ring");
            neckSlot = new UIButton(new Vector2(armorEquipPosition.X + 5 * (CELLWIDTH), armorEquipPosition.Y),
                false, "UI/NeckOverlay", "Neck");

            weaponSlot1 = new UIButton(new Vector2(weaponEquipPosition.X, weaponEquipPosition.Y),
                false, "UI/InvSlot", "Left");
            weaponSlot2 = new UIButton(new Vector2(weaponEquipPosition.X + CELLWIDTH, weaponEquipPosition.Y),
                false, "UI/InvSlot", "Right");

            texState.AddressU = TextureAddressMode.Clamp;
            texState.AddressV = TextureAddressMode.Clamp;
            texState.AddressW = TextureAddressMode.Clamp;
            texState.Filter = TextureFilter.Linear;

            //StartGame();
        }