Example #1
0
        public PlotScreen(GameLoop _game, MusicManager _musicPlayer, ArrayList _textures, ArrayList _fonts)
        {
            currPlotScreen = 0;

            game = _game;
            musicPlayer = _musicPlayer;
            textures = _textures;
            fonts = _fonts;
        }
Example #2
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;
        }
        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();
        }
Example #4
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);
        }
Example #5
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;
 }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            config = new GameLoader(@"Content\lathraia.config");

            textures = new ArrayList();
            for (int i = 0; i < config.NumTextures; i++)
            {
                textures.Insert(i, Content.Load<Texture2D>(config.getTextureFile(i)));
            }

            fonts = new ArrayList();
            for (int i = 0; i < config.NumFonts; i++)
            {
                fonts.Insert(i, Content.Load<SpriteFont>(config.getFontFile(i)));
            }

            sounds = new ArrayList();
            for (int i = 0; i < config.NumSoundEffects; i++)
            {
                sounds.Insert(i, Content.Load<SoundEffect>(config.getSoundFile(i)));
            }

            songs = new ArrayList();
            for (int i = 0; i < config.NumSongs; i++)
            {
                songs.Insert(i, Content.Load<Song>(config.getSongFile(i)));
            }

            musicPlayer = new MusicManager(songs);
        }