public override void Execute() { Column pColumn = (Column)this.pAlien.pParent; Grid pGrid = (Grid)pColumn.pParent; this.pAlien.Remove(); pColumn.alienCount--; pGrid.alienCount--; TimerManager.UpdateTimerManager(pGrid); if (pColumn.alienCount == 0) { ((GameObject)pColumn).Remove(); pGrid.colCount--; } if (pGrid.alienCount == 0) { // Round over! Start next round ((GameObject)pGrid).Remove(); ScoreManager.OneUp(); //ShipManager.MoveShip(150.0f, 100.0f); TimerManager.ClearTimerManager(); UFOManager.Deactivate(); //TimerManager.Dump(); Game pGame = GameManager.GetGame(); pGame.roundNum++; GameManager.ActivateGame(false); UFOManager.Activate(); TimerManager.InitializeTimerManager(); } }
public override void Update() { if (GameManager.GetGame().GetState() is GameActiveState) { GameObject ship = ShipManager.GetShip(); if (ship != null) { ship.Remove(); GameObject pShipRoot = GameObjectManager.Find(GameObjectName.ShipRoot); pShipRoot.Remove(); } Alien pExplosion = new Explosion(GameObjectName.Explosion, SpriteBaseName.Explosion, AlienType.Explosion, ship, ColorName.Green, 0); SpriteBatch sbAliens = SpriteBatchManager.Find(SpriteBatchName.Aliens); SpriteBatch sbBoxes = SpriteBatchManager.Find(SpriteBatchName.Boxes); pExplosion.ActivateGameSprite(sbAliens); pExplosion.ActivateCollisionSprite(sbBoxes); GameObjectManager.AttachTree(pExplosion); Game pGame = GameManager.GetGame(); pGame.roundNum = 1; ScoreManager.ClearLives(); TimerManager.ClearTimerManager(); pExplosion.Remove(); pGame.Die(); TimerManager.Add(TimerEventName.GameStart, TimerManager.GetCurrentTime() + 10.0f, 10.0f, new GameStartEvent(pGame)); } }
public override void Update() { if (GameManager.GetGame().GetState() is GameActiveState) { Ship pShip = ShipManager.GetShip(); pShip.Shoot(); } }
public override void Update() { Game pGame = GameManager.GetGame(); if (pGame.GetState() is GameSelectState) { GameManager.ActivateGame(pGame.roundNum == 1); TimerManager.InitializeTimerManager(); } }
public override void Update() { if (GameManager.GetGame().GetState() is GameActiveState) { Ship pShip = ShipManager.GetShip(); if (pShip.x < 55.0f) { // TODO: synch this up with actual LeftWall x placement. // Don't move } else { pShip.MoveLeft(); } } }
public override void Update() { //Debug.WriteLine("RemoveShipObserver: {0} {1}", this.pSubject.goA, this.pSubject.goB); GameObject ship = ShipManager.GetShip(); if (ship != null) { ship.Remove(); GameObject pShipRoot = GameObjectManager.Find(GameObjectName.ShipRoot); pShipRoot.Remove(); } Alien pExplosion = new Explosion(GameObjectName.Explosion, SpriteBaseName.Explosion, AlienType.Explosion, ship, ColorName.Green, 0); SpriteBatch sbAliens = SpriteBatchManager.Find(SpriteBatchName.Aliens); SpriteBatch sbBoxes = SpriteBatchManager.Find(SpriteBatchName.Boxes); pExplosion.ActivateGameSprite(sbAliens); pExplosion.ActivateCollisionSprite(sbBoxes); GameObjectManager.AttachTree(pExplosion); Game pGame = GameManager.GetGame(); //pGame.Pause(); int lives = ScoreManager.UpdateLives(); if (lives == 0) { pGame.roundNum = 1; TimerManager.ClearTimerManager(); pExplosion.Remove(); pGame.Die(); TimerManager.Add(TimerEventName.GameStart, TimerManager.GetCurrentTime() + 10.0f, 10.0f, new GameStartEvent(pGame)); } else { TimerManager.Add(TimerEventName.RemoveGameObject, TimerManager.GetCurrentTime(), TimerManager.GetCurrentTime(), new RemoveGameObjectCommand(pExplosion)); PCSTree pRootTree = GameObjectManager.GetRootTree(); //ShipRoot pShipRoot = (ShipRoot)GameObjectManager.Find(GameObjectName.ShipRoot); //pShipRoot.ActivateCollisionSprite(sbBoxes); //pShipRoot.ActivateGameSprite(sbAliens); ShipManager.Create(GameManager.GetCollisionBoxes()); } }
public override void execute(float currentTime) { Game pGame = GameManager.GetGame(); pGame.SetState(GameStateEnum.Select); }