public override void Initialize() { _spriteBatch = Game.Services.GetService<SpriteBatch>(); _rhythmEngine = Game.Services.GetService<RhythmEngine>(); base.Initialize(); }
public void Initialize(Game game) { _comboUpSound = game.Content.Load<SoundEffect>("Sounds\\Combo").CreateInstance(); _comboBreakerSound = game.Content.Load<SoundEffect>(@"Sounds\ComboBreaker").CreateInstance(); _rhythmEngine = game.Services.GetService<RhythmEngine>(); _melodies.Clear(); _melodies.Add(0, new ComboLevelMelody(game.Content.Load<SoundEffect>("Sounds\\Melody1Level1"))); _melodies.Add(8, new ComboLevelMelody(game.Content.Load<SoundEffect>("Sounds\\Melody1Level2"))); PlayMelody(true); }
public GameOverScript(Game game) { _screenManager = game.Services.GetService<ScreenManager>(); _rhythmEngine = game.Services.GetService<RhythmEngine>(); }
public RhythmMelodyPlayer(RhythmEngine engine) { _engine = engine; }
public override void LoadContent() { this.CreateAd(); var game = ScreenManager.Game; GameState = game.Services.GetService<GameState>(); // ********************************************************* // DO NOT forget to remove all added here // services and game components on UnloadContent // ********************************************************* var services = ScreenManager.Game.Services; // Rhythm engine _rhythmEngine = new RhythmEngine(ScreenManager.Game); _rhythmEngine.Initialize(); services.AddService(_rhythmEngine); _touchService = new TouchService(); services.AddService(_touchService); _inputHandler = new WindowsInputHandler(ScreenManager.Game, this); _inputHandler.Initialize(); _comboController = new ComboController(100); GameState.Combo = _comboController; _comboController.Initialize(ScreenManager.Game); GameState.Player.AddScript(new CheckForPickableObjectsScript(game)); // Resources services.AddService(new ResourceBuilder(new InventoryMappingService())); Level.Initialize(ScreenManager.Game, ScreenManager.SpriteBatch, GameState.Camera, GameState); GameState.Camera.Initialize(game); GameState.Player.Initialize(game, ScreenManager.SpriteBatch); _levelUI = new LevelUI(ScreenManager.Game); _levelUI.Initialize(); //// Effects //_bloom = new BloomComponent(ScreenManager.Game); //_bloom.Initialize(); //services.AddService(_bloom); WireUpEvents(); ApplyDefaultMatchingStrategy(); base.LoadContent(); }