//***************************************************************************** //***************************************************************************** // New Game Initialize //***************************************************************************** //***************************************************************************** private static void InitializeNewGame() { //Load things Texture2D bgTex = new Texture2D("/Application/Assets/Background.png", false); background = new BackGround(graphics, bgTex); playership = new PlayerShip(graphics); powerstation = new PowerStation(graphics); enemyList = new List <Enemy> (); weaponPlayerList = new List <Weapon>(); weaponScaterList = new List <Weapon>(); projectileList = new List <Projectile>(); projectileListE = new List <Projectile>(); hud = new HUD(graphics); r = new Random(); badguyTimer = 0; //LoadingSounds MusicPlay("/Application/Assets/MainPlay.mp3"); //WeaponSounds Sound soundEffect; soundEffect = new Sound("/Application/Assets/Bullet.wav"); bulletSound = soundEffect.CreatePlayer(); soundEffect = new Sound("/Application/Assets/Missle.wav"); missleSound = soundEffect.CreatePlayer(); soundEffect = new Sound("/Application/Assets/DropBomb.wav"); dropBombSound = soundEffect.CreatePlayer(); //enemy creation texture = new Texture2D("/Application/Assets/MotherShip.png", false); enemyList.Add(new MotherShip(graphics, texture, powerstation, enemyList, 1000, 1, -200, 50)); CreateSmallBaddys(); texture = new Texture2D("/Application/Assets/Guardian.png", false); enemyList.Add(new Guardian(graphics, texture, playership, enemyList, 250, 2, 0, r.Next(600, 1000))); //Weapon Creation gunTexFile = "/Application/Assets/gun.png"; texture = new Texture2D(gunTexFile, false); weaponScaterList.Add(new Guns(graphics, texture, new Vector3(200, 300, 0), 0f, 1)); missleTexFile = "/Application/Assets/MissleGun.png"; texture = new Texture2D(missleTexFile, false); weaponScaterList.Add(new Guns(graphics, texture, new Vector3(400, 200, 0), 0f, 2)); DropOffTexFile = "/Application/Assets/DropBox.png"; texture = new Texture2D(DropOffTexFile, false); weaponScaterList.Add(new Guns(graphics, texture, new Vector3(600, 100, 0), 0f, 3)); currentState = GameState.Playing; }
public MotherShip(GraphicsContext g, Texture2D tex, PowerStation pStn, List <Enemy> eList, int hp, int st, int x, int y) : base(g, tex, hp, st) { shipWidth = sprite.Width; shipHeight = sprite.Height; // this may need to be killed later. position = new Vector3(x, y, 0); // you are going to adjust here to move it off screen. sprite.Position = position; sprite.Center = new Vector2(.5f, .5f); speed = .5f; velocity = new Vector3(0, 0, 0); powerstation = pStn; enemyList = eList; rotation = 0; point1 = false; stpDist = 0; }