public void Draw(SpriteBatch spriteBatch) { // Draw Players + Respective Bullets spriteBatch.Draw(Background, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), Color.White); foreach (Ship CurShip in ShipList) { CurShip.Draw(spriteBatch); } }
public void Update(KeyboardState curKeyState) { foreach (Ship CurShip in ShipList) { if (CurShip.GetType() == typeof(PlayerShip)) { CurShip.Update(curKeyState); } else if (CurShip.GetType() == typeof(ChargerShip)) { if (ShipList[1].GetType() == typeof(PlayerShip)) { Random rnd = new Random(); int i = rnd.Next(0, 2); CurShip.Update(ShipList[i].shipPosition); } else { CurShip.Update(ShipList[0].shipPosition); } } } }