Esempio n. 1
0
        public override void AttachInputObservers()
        {
            InputSubject pInputSubject;

            // TODO Remove -- Testing
            pInputSubject = InputManager.GetKeyNSubject();
            pInputSubject.Attach(new ChangeGameStateObserver());

            pInputSubject = InputManager.GetArrowRightSubject();
            pInputSubject.Attach(new MoveRightObserver());

            pInputSubject = InputManager.GetArrowLeftSubject();
            pInputSubject.Attach(new MoveLeftObserver());

            pInputSubject = InputManager.GetSpaceSubject();
            pInputSubject.Attach(new ShootObserver());

            pInputSubject = InputManager.GetKey1Subject();
            pInputSubject.Attach(new ToggleSpriteBatchDrawObserver(pCollisionBox_SpriteBatch));

            pInputSubject = InputManager.GetKey2Subject();
            pInputSubject.Attach(new ToggleSpriteBatchDrawObserver(pShield_SpriteBatch));
        }