コード例 #1
0
 /// <summary>
 /// Create a loss state
 /// </summary>
 /// <param name="game">Game being lost</param>
 public LoseState(AtlasWarriorsGame.Game game)
 {
     Game          = game;
     LoseTitleFont = AppContentManager.Load <SpriteFont>("LoseState/LoseTitle");
     LoseTextFont  = AppContentManager.Load <SpriteFont>("LoseState/LoseText");
     LastState     = Keyboard.GetState();
 }
コード例 #2
0
        /// <summary>
        /// Create a game interface from a given game
        /// </summary>
        /// <param name="Game">Game object that is being played</param>
        public GameMapState(AtlasWarriorsGame.Game Game)
        {
            this.G = Game;

            MapView  = new MgUiCommon.MapViewElement(Game, AppGraphicsDevice, AppContentManager);
            LogFont  = AppContentManager.Load <SpriteFont>("GameMapState/LogFont");
            StatFont = AppContentManager.Load <SpriteFont>("GameMapState/StatFont");
        }
コード例 #3
0
        /// <summary>
        /// Create a game interface from a given game
        /// </summary>
        /// <param name="game">Game object that is being played</param>
        /// <param name="metrics">Display metrics of mobile</param>
        public GameMapState(AtlasWarriorsGame.Game game, DisplayMetrics metrics)
        {
            this.G = game;

            LogFont  = AppContentManager.Load <SpriteFont>("GameMapState/LogFont");
            MapView  = new MgUiCommon.MapViewElement(game, AppGraphicsDevice, AppContentManager);
            StatFont = AppContentManager.Load <SpriteFont>("GameMapState/StatFont");

            Dpi = metrics.Xdpi;
        }
コード例 #4
0
ファイル: TitleState.cs プロジェクト: lkingsford/7drl18
        public TitleState()
        {
            background = AppContentManager.Load <Texture2D>("Title/Title");


            if (gui == null)
            {
                inputListener = new InputListenerComponent(GameApp);
                inputManager  = new MonoGame.Extended.NuclexGui.GuiInputService(inputListener);
                gui           = new GuiManager(GameApp.Services, inputManager);
                gui.Initialize();
            }
            gui.Screen   = new GuiScreen();
            btnStartGame = new GuiButtonControl
            {
                Name   = "Start Game",
                Bounds = new UniRectangle(new UniVector(new UniScalar(540), new UniScalar(200)), new UniVector(new UniScalar(200), new UniScalar(70))),
                Text   = "Start Game"
            };
            btnQuitGame = new GuiButtonControl
            {
                Name   = "Quit Game",
                Bounds = new UniRectangle(new UniVector(new UniScalar(540), new UniScalar(300)), new UniVector(new UniScalar(200), new UniScalar(70))),
                Text   = "Quit Game"
            };
            btnQuitGame.Pressed += BtnQuitGame_Pressed;
            gui.Screen.Desktop.Children.Add(btnQuitGame);

            windowStarting = new GuiWindowControl()
            {
                Name   = "Starting",
                Bounds = new UniRectangle(new UniVector(new UniScalar(240), new UniScalar(200)), new UniVector(new UniScalar(800), new UniScalar(100))),
                Title  = "Starting Game..."
            };

            btnStartGame.Pressed += OnStartGamePressed;
            gui.Screen.Desktop.Children.Add(btnStartGame);

            lblStatus = new GuiLabelControl()
            {
                Bounds = new UniRectangle(new UniVector(new UniScalar(10), new UniScalar(0)), new UniVector(new UniScalar(800), new UniScalar(100))),
                Text   = ""
            };

            windowStarting.Children.Add(lblStatus);
        }
コード例 #5
0
        /// <summary>
        /// Create a game interface from a given game
        /// </summary>
        /// <param name="Game">Game object that is being played</param>
        public GameState(Game.Game Game, Microsoft.Xna.Framework.Game MonogameGame)
        {
            this.G = Game;

            this.G.TellStory = ShowStory;

            MapTileSprites       = AppContentManager.Load <Texture2D>("MapTiles");
            PCSprites            = AppContentManager.Load <Texture2D>("CharacterSprites");
            MomentumSprite       = AppContentManager.Load <Texture2D>("UiElements/MomentumMarker");
            SpentMomentumSprite  = AppContentManager.Load <Texture2D>("UiElements/SpentMomentumMarker");
            HpSprite             = AppContentManager.Load <Texture2D>("UiElements/HpMarker");
            MovementArrowsSprite = AppContentManager.Load <Texture2D>("UiElements/Arrows");
            MonsterDetailsFont   = AppContentManager.Load <SpriteFont>("UiElements/MonsterDisplay");
            StateFont            = AppContentManager.Load <SpriteFont>("UiElements/TurnState");

            arrowWidth  = MovementArrowsSprite.Width / 9;
            arrowHeight = MovementArrowsSprite.Height / 3;

            minimap           = new Minimap(Game, MonogameGame);
            minimap.showCrime = true;

            gui.Screen = new GuiScreen();

            storyWindow = new GuiWindowControl()
            {
                Name   = "StoryWindow",
                Bounds = new UniRectangle(new UniVector(new UniScalar(190), new UniScalar(200)), new UniVector(new UniScalar(900), new UniScalar(200))),
            };

            storyText = new GuiLabelControl()
            {
                Name   = "StoryText",
                Bounds = new UniRectangle(new UniVector(new UniScalar(10), new UniScalar(0)), new UniVector(new UniScalar(500), new UniScalar(120))),
            };
            storyWindow.Children.Add(storyText);

            storyButton = new GuiButtonControl()
            {
                Bounds = new UniRectangle(new UniVector(new UniScalar(375), new UniScalar(120)), new UniVector(new UniScalar(150), new UniScalar(70))),
                Text   = "Continue"
            };
            storyWindow.Children.Add(storyButton);
            storyButton.Pressed += StoryButton_Pressed;

            G.StartGame();
        }
コード例 #6
0
ファイル: DeadState.cs プロジェクト: lkingsford/7drl18
        public DeadState(Game.Game g)
        {
            this.g = g;

            gui.Screen = new GuiScreen();
            gui.Initialize();

            btnTitle = new GuiButtonControl
            {
                Name   = "Return to title",
                Bounds = new UniRectangle(new UniVector(new UniScalar(490), new UniScalar(600)), new UniVector(new UniScalar(300), new UniScalar(70))),
                Text   = "Return to title"
            };
            btnTitle.Pressed += BtnTitle_Pressed;
            gui.Screen.Desktop.Children.Add(btnTitle);

            if (g.DeadZulu)
            {
                background = AppContentManager.Load <Texture2D>("Title/Victory");
                DeathText  = $@"Zulu has fallen, and the denizens of New London are at peace once more.

You slayed {g.DeadLackeys} of Zulu's lackeys.
You slayed {g.DeadKnifes} of Zulu's cutters.
You slayed {g.DeadBrutes} of Zulu's brutes.
Zulu has been slain.";
            }
            else
            {
                background = AppContentManager.Load <Texture2D>("Title/Gameover");
                DeathText  = $@"Your vegeance was not satisfied.
The city of New London remains under the criminal guard of Zulu.

You slayed {g.DeadLackeys} of Zulu's lackeys.
You slayed {g.DeadKnifes} of Zulu's cutters.
You slayed {g.DeadBrutes} of Zulu's brutes.
Zulu remains alive.";
            }

            DeathFont = AppContentManager.Load <SpriteFont>("GameOverFont");
        }
コード例 #7
0
 public Minimap(Game.Game Game, Microsoft.Xna.Framework.Game MonogameGame)
 {
     this.G             = Game;
     MinimapTileSprites = AppContentManager.Load <Texture2D>("MinimapTiles");
     CrimeRateSprite    = AppContentManager.Load <Texture2D>("CrimeRate");
 }