/// <summary>
        /// Constucts and assigns the basic data
        /// </summary>
        /// <param name="graphicsDevice"></param>
        /// <param name="colorMap"></param>
        /// <param name="fonts"></param>
        /// <param name="screenChanged"></param>
        public SettingsScreen( GraphicsDevice graphicsDevice, ColorMap colorMap, List<SpriteFont> fonts, ScreenChanged screenChanged )
        {
            // subscribe to the delegate invocation list
            _screenChanged += screenChanged;

            // assign references to the local instance refs
            _graphicsDevice = graphicsDevice;
            _colorMap = colorMap;
            _fonts = fonts;
        }
        /// <summary>
        /// Creates the achievements screen and assigns the basic data
        /// </summary>
        /// <param name="graphicsDevice"></param>
        /// <param name="colorMap"></param>
        /// <param name="fonts"></param>
        /// <param name="screenChanged"></param>
        public TopScoresScreen( GraphicsDevice graphicsDevice, ColorMap colorMap, List<SpriteFont> fonts, ScreenChanged screenChanged )
        {
            // subscribe the delegate
            _screenChanged += screenChanged;

            // assign the refs to the local instances
            _graphicsDevice = graphicsDevice;
            _colorMap = colorMap;
            _fonts = fonts;
        }
        /// <summary>
        /// Creates the color plate track and assigned the provided data
        /// </summary>
        /// <param name="graphicsDevice"></param>
        /// <param name="colorMap"></param>
        /// <param name="velocity"></param>
        /// <param name="font"></param>
        /// <param name="difficulty"></param>
        public ColorPlateTrack( GraphicsDevice graphicsDevice, ColorMap colorMap, SpriteFont font, Difficulty difficulty )
        {
            // assign res to local refs
            this.TrackDifficulty = difficulty;
            this.font = font;
            this.Velocity = (int)difficulty;
            this.TrackColorMap = colorMap;

            // add the first plate to the track
            ColorPlates = new List<ColorPlate>();
            ColorPlates.Add( CreateColorPlate( graphicsDevice ) );
        }
Beispiel #4
0
        /// <summary>
        /// Creates the main screen and assigns the provided instances to local refs
        /// </summary>
        /// <param name="graphicsDevice"></param>
        /// <param name="colorMap"></param>
        /// <param name="fonts"></param>
        /// <param name="method"></param>
        public MainScreen( GraphicsDevice graphicsDevice, ColorMap colorMap, List<SpriteFont> fonts, ScreenChanged method )
        {
            // subscribe to the delegate invocation list
            _screenChanged += method;

            // assign refs to the local instances
            _graphicsDevice = graphicsDevice;
            _fonts = fonts;
            _colorMap = colorMap;

            // create a new track for the main screen with the top difficulty
            _track = new ColorPlateTrack( graphicsDevice, colorMap, _fonts[ 0 ], Difficulty.Asian );
        }
Beispiel #5
0
        /// <summary>
        /// Instantiates the game screen and sets up the base values
        /// </summary>
        /// <param name="graphicsDevice"></param>
        /// <param name="colorMap"></param>
        /// <param name="fonts"></param>
        /// <param name="screenChanged"></param>
        public GameScreen( GraphicsDevice graphicsDevice, ColorMap colorMap, List<SpriteFont> fonts, ScreenChanged screenChanged )
        {
            // subscribe to the screen change delegate
            _screenChanged += screenChanged;

            // assign the local refs
            _graphicsDevice = graphicsDevice;
            _colorMap = colorMap;
            _fonts = fonts;

            // create the track
            Track = new ColorPlateTrack( _graphicsDevice, colorMap, _fonts[ 0 ], Difficulty.Pro /*alter to populate from settings*/ );
        }
        /// <summary>
        /// Creates the Screen manager and inits the base data
        /// </summary>
        /// <param name="graphicsDevice"></param>
        /// <param name="colorMap"></param>
        /// <param name="fonts"></param>
        public ScreenManager( GraphicsDevice graphicsDevice, ColorMap colorMap, List<SpriteFont> fonts )
        {
            // assign local refs
            _graphicsDevice = graphicsDevice;
            _colorMap = colorMap;
            _fonts = fonts;

            // set the default screen
            _currentScreen = Screen.Main;
            _nextScreen = Screen.None;

            // create all screens
            _mainScreen = new MainScreen( _graphicsDevice, _colorMap, _fonts, ScreenChanged );
            _gameScreen = new GameScreen( _graphicsDevice, _colorMap, _fonts, ScreenChanged );
            _settingsScreen = new SettingsScreen( _graphicsDevice, _colorMap, _fonts, ScreenChanged );
            _topScoresScreen = new TopScoresScreen( _graphicsDevice, _colorMap, _fonts, ScreenChanged );

            // set up the swapping texture
            _bgT = ItemFactory.CreateFilledTexture( _graphicsDevice, 1, 480, Color.Black );
        }
Beispiel #7
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Load the required fonts
            _fonts = new List<SpriteFont>();
            _fonts.Add( Content.Load<SpriteFont>( "Motorwerk24" ) );
            _fonts.Add( Content.Load<SpriteFont>( "Motorwerk40" ) );
            _fonts.Add( Content.Load<SpriteFont>( "Motorwerk54" ) );

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch( GraphicsDevice );

            // Create a new color map
            _colorMap = new ColorMap( GraphicsDevice );

            // Create a new background
            _background = new BackgroundTrack( GraphicsDevice );

            // Create a new screen manager with the given color map and the loaded fonts
            _screenManager = new ScreenManager( GraphicsDevice, _colorMap, _fonts );
        }