public BaseGameScreen(string name, BaseGame game, List <IComponent> components = null) { Game = game; Name = name; if (components == null) { Components = new ComponentStore(); } else { Components = new ComponentStore(components); } Textures = new Dictionary <string, Texture2D>(); SoundEffects = new Dictionary <string, SoundEffect>(); }
public BaseGameScreen(string name, BaseGame game, List<IComponent> components = null) { Game = game; Name = name; if (components == null) { Components = new ComponentStore(); } else { Components = new ComponentStore(components); } Textures = new Dictionary<string, Texture2D>(); SoundEffects = new Dictionary<string, SoundEffect>(); }
public SpaceGameScreen(string name, BaseGame game) : base(name, game) { Game.IsMouseVisible = false; Components.Add<CollisionService>(new CollisionService(Components)); Components.Add<ScoreService>(new ScoreService()); Components.Add<SoundService>(new SoundService()); Components.Add<KeyboardService>(new KeyboardService()); Components.Add<MovementService>(new MovementService(Components)); Components.Add<AsteroidService>(new AsteroidService(Components)); Components.Add<ShipService>(new ShipService(Components, this)); var keyboardService = Components.GetSingle<KeyboardService>(); keyboardService.RegisterKeyListener(new KeyboardService.KeyCombination(Keys.Escape, KeyboardService.KeyEventType.Pressed), ToMainMenu); LoadTextures(); LoadSoundEffects(); Reset(); }