예제 #1
0
 private void InitializeFonts()
 {
     // Fonts are loaded here
     _font = new PotatoEngine.Font(_textureManager.Get("font"),
                                   FontParser.Parse("Assets/Textures/Fonts/font.fnt"));
     _titleFont = new PotatoEngine.Font(_textureManager.Get("title_font"),
                                        FontParser.Parse("Assets/Textures/Fonts/title_font.fnt"));
     _generalFont = new PotatoEngine.Font(_textureManager.Get("general_font"),
                                          FontParser.Parse("Assets/Textures/Fonts/general_font.fnt"));
 }
예제 #2
0
        public StartMenuState(PotatoEngine.Font font, PotatoEngine.Font titleFont, PotatoEngine.Font generalFont, Input input, StateSystem system, SoundManager soundManager)
        {
            _input        = input;
            _generalFont  = generalFont;
            _system       = system;
            _soundManager = soundManager;
            _fps          = new FPS(font, new Color(0, 0, 0, 1));

            InitializeMenu();

            _title = new Text("The Darkest Matter", titleFont);
            _title.SetColor(new Color(0, 0, 0, 1));
            // Center on the x and place somewhere near the top
            _title.SetPosition(-_title.Width / 2, 300);
        }
예제 #3
0
        public Level(Input input, TextureManager textureManager, PersistantGameData gameData, SoundManager soundManager, PotatoEngine.Font generalFont)
        {
            _input          = input;
            _textureManager = textureManager;
            _soundManager   = soundManager;
            _gameData       = gameData;

            _background = new ScrollingBackground(_textureManager.Get("background"));
            _background.SetScale(2, 2);
            _background.Speed = 0.15f;

            _backgroundLayer = new ScrollingBackground(_textureManager.Get("background_layer_1"));
            _backgroundLayer.SetScale(2, 2);
            _backgroundLayer.Speed = 0.1f;

            _planet_28         = new Sprite();
            _planet_28.Texture = _textureManager.Get("planet_28");
            _planet_28.SetScale(0.5, 0.5);
            _planet_28.SetPosition(300, -300);

            _playArea        = new RectangleF(-1260 / 2, -750 / 2, 1260, 750);
            _bulletManager   = new BulletManager(_playArea);
            _effectsManager  = new EffectsManager(_textureManager);
            _playerCharacter = new PlayerCharacter(_textureManager, _effectsManager, _bulletManager, _playArea);

            if (_gameData.NewGame)
            {
                _playerCharacter.Lives = _startLives;
                _playerCharacter.Score = 0;
            }
            else
            {
                _playerCharacter.Lives = _gameData.Lives;
                _playerCharacter.Score = _gameData.Score;
            }

            _enemyManager = new EnemyManager(_textureManager, _effectsManager, _bulletManager, _playerCharacter, _playArea, _gameData.CurrentLevel.Enemies, -1300);

            Finished = false;
        }