Ejemplo n.º 1
0
        public InitialMatchState(IAnarkanoidGame arkanoidGame, IKeysConfiguration keysConfiguration) : base(arkanoidGame, keysConfiguration)
        {
            //Components.SpaceShip.Reset();
            //Components.Ball.Reset();

            //BORRAR PREMIOS
            AnarkanoidGame.ComponentManager.RemovePrizes();

            _timer          = new Timer(Configuration.BallInitialHookedMiliseconds);
            _timer.Elapsed += (sender, e) =>
            {
                foreach (IBall currentBall in Components.Balls)
                {
                    currentBall.Unhook();
                }
                _timer.Stop();
                _timer.Dispose();
            };
            _timer.Start();

            CommandPerKey.Add(Keys.Left, CommandsFactory.GetMoveSpaceShipToLeftCommand());
            CommandPerKey.Add(Keys.Right, CommandsFactory.GetMoveSpaceShipToRightCommand());
            CommandPerKey.Add(Keys.Shoot, CommandsFactory.GetUnhookBallCommand());
        }