Ejemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (GameLoop game = new GameLoop())
     {
         game.Run();
     }
 }
Ejemplo n.º 2
0
 public GameOver(GameLoop game, Texture2D _background, SpriteFont _menuFont, InputHandler _inputHandler)
     : base(game)
 {
     background = _background;
     gameLoop = game;
     menuFont = _menuFont;
     selectedIndex = 0;
     inputHandler = _inputHandler;
 }
Ejemplo n.º 3
0
        public PlotScreen(GameLoop _game, MusicManager _musicPlayer, ArrayList _textures, ArrayList _fonts)
        {
            currPlotScreen = 0;

            game = _game;
            musicPlayer = _musicPlayer;
            textures = _textures;
            fonts = _fonts;
        }
Ejemplo n.º 4
0
        public PlayerAnimation(GameLoop game, IPlayer _player)
        {
            screenWidth = game.GraphicsDevice.Viewport.Width;

            AnimationVelocity = 1;
            action = Action.right;

            random = new Random();
            tiles = new List<ITile>();

            player = _player;
            player.ToggleHealthBar();
        }
Ejemplo n.º 5
0
        public LevelIntroScreen(GameLoop _game, SpriteFont _font)
            : base(_game)
        {
            position = new Rectangle(0, 0, Game.GraphicsDevice.Viewport.Width, Game.GraphicsDevice.Viewport.Height);
            verticalLine = new Rectangle(60, 0, 2, Game.GraphicsDevice.Viewport.Height);

            source = new Rectangle(0, 0, 0, 0);
            textPosition = new Vector2(70, Game.GraphicsDevice.Viewport.Width/2.5f);

            game = _game;
            font = _font;

            texture = new Texture2D(game.GraphicsDevice, 1, 1);
            texture.SetData(new Color[] { Color.White });
        }
Ejemplo n.º 6
0
        public TitleScreen(GameLoop game, Texture2D _background, Texture2D _logo, SpriteFont _menuFont, MusicManager _musicPlayer, InputHandler _inputHandler)
            : base(game)
        {
            background = _background;
            logo = _logo;
            musicPlayer = _musicPlayer;

            gameLoop = game;
            menuFont = _menuFont;
            inputHandler = _inputHandler;
            blinkCount = 0;
            logoCount = 35;
            currFadeStep = fadeDelay;
            channelValue = 1;
        }
Ejemplo n.º 7
0
        public Level(GameLoop game, ArrayList _textures, ArrayList _fonts, ArrayList _sounds, LevelLoader loader)
            : base(game)
        {
            int screenWidth = Game.GraphicsDevice.Viewport.Width;
            int screenHeight = Game.GraphicsDevice.Viewport.Height;
            bolts = new List<Bolt>();
            playerRange = new Rectangle((screenWidth * 2)/5, 0, screenWidth/5, screenHeight);

            levelLoader = loader;
            textures = _textures;
            sounds = _sounds;

            currentLevel = 0;
            deathCounter = 0;

            screenWidth = Game.GraphicsDevice.Viewport.Width;
            screenHeight = Game.GraphicsDevice.Viewport.Height;

            gameTimer = new GameTimer(360, (SpriteFont)_fonts[0]);
            InitLevel();
        }
        public ScrollingTextScreen(GameLoop _game, Texture2D _background, MusicManager _musicPlayer, int _songIndex, string[] _scrollingText, ArrayList _fonts, int[] _fontIndices, Justification _justification)
        {
            game = _game;

            background = _background;
            musicPlayer = _musicPlayer;
            songIndex = _songIndex;

            scrollingText = _scrollingText;
            fonts = _fonts;
            fontIndices = _fontIndices;
            justification = _justification;

            screenCenter = game.GraphicsDevice.Viewport.Width / 2;
            screenHeight = game.GraphicsDevice.Viewport.Height;

            bgPosition = new Rectangle(0, 0, game.GraphicsDevice.Viewport.Width, screenHeight);
            bgSource = new Rectangle(0, 0, background.Width, background.Height);

            textPosition = new Vector2[scrollingText.Length];
            initScrollingTextScreen();
        }
Ejemplo n.º 9
0
        public Level(GameLoop game, ArrayList _textures, ArrayList _fonts, ArrayList _sounds, MusicManager _musicPlayer, PlotScreen _plotScreen, LevelLoader loader, InputHandler _inputHandler)
            : base(game)
        {
            int screenWidth = Game.GraphicsDevice.Viewport.Width;
            int screenHeight = Game.GraphicsDevice.Viewport.Height;

            bolts = new List<Bolt>();
            torches = new List<Torch>();
            guards = new List<IGuard>();
            levers = new List<Lever>();
            gates = new List<Gate>();
            boxBolts = new List<BoxOfBolts>();
            buttons = new List<Button>();
            spouts = new List<Spout>();

            playerRange = new Rectangle((screenWidth * 2) / 5, 0, screenWidth / 5, screenHeight);

            levelLoader = loader;
            textures = _textures;
            sounds = _sounds;
            fonts = _fonts;

            musicPlayer = _musicPlayer;
            plotScreen = _plotScreen;
            guardFactory = new GuardFactory((Texture2D)textures[wizardIndex], (Texture2D)textures[soldierIndex], (Texture2D)textures[LOSIndex]);

            currentLevel = 0;
            deathCounter = 0;

            screenWidth = Game.GraphicsDevice.Viewport.Width;
            screenHeight = Game.GraphicsDevice.Viewport.Height;

            this.game = game;
            inputHandler = _inputHandler;
            levelLoader.LoadLevel(currentLevel);
        }
Ejemplo n.º 10
0
 public Credits(GameLoop _game, Texture2D _background, MusicManager _musicPlayer, ArrayList _fonts)
     : base(_game, _background, _musicPlayer, _songIndex, credits, _fonts, creditFonts, _justification)
 {
     thanksWidth = (int)((SpriteFont)fonts[3]).MeasureString(thankYou).X;
 }