//Constructor ---------------------------------------------------------------- public MissleManager(ContentManager content, SpriteBatch spriteBatch) { this.z_playerShip = PlayerShip.getInstance(); this.z_missiles = new List<MissileObject>(); PlayerMissile1.Initialize(content); z_instanceOf = this; }
//Constructor ---------------------------------------------------------------- public MissleManager(Rectangle newViewPort, ContentManager content, SoundEffect sound, SpriteBatch spriteBatch, PlayerShip playerShip) { this.z_playerShip = playerShip; this.z_enemyManager = EnemyManager.getInstance(content, spriteBatch, newViewPort); this.z_FriendlyMissles = new List<MissleObject>(); this.z_EnemyMissles = new List<MissleObject>(); this.z_viewPort = newViewPort; this.z_friendlyMissleSprite1 = content.Load<Texture2D>("Content\\Images\\Missles\\Ball1"); this.z_fireSound1 = sound; this.z_EnemyShipList = new List<IEnemyShip>(); this.z_bulletPool = new BulletPool1(content, this.z_viewPort, this.z_playerShip, spriteBatch); this.z_enemyBulletPool1 = new EnemyBulletPool1(content, this.z_viewPort, spriteBatch); instanceOf = this; }
public StageManager(SpriteBatch spriteBatch, Rectangle viewPort, ContentManager content) { this.z_isGameOver = false; this.z_spriteBatch = spriteBatch; z_viewportRec = viewPort; this.z_contentManager = content; z_objects = new List<GameObject>(); z_objects.Add(new ScrollingBackground(this.z_contentManager.Load<Texture2D>("Content\\Textures\\Starscape4"))); //Set the starting position for player's ship this.z_startingPosition = new Vector2(z_viewportRec.Center.X, z_viewportRec.Height - 80); //Create the player ship this.z_playerShip = PlayerShip.getInstance(this.z_contentManager.Load<Texture2D>("Content\\Images\\ship1"), this.z_startingPosition); // create the mission manager this.z_missionManager = new MissionManager(z_contentManager); //Set the player alive this.z_playerShip.IsAlive = true; //Load the Music this.z_MarksSong = this.z_contentManager.Load<Song>("Content\\Audio\\Music\\ATreeFalls"); MediaPlayer.IsRepeating = true; //Load Fonts this.z_timerFont = this.z_contentManager.Load<SpriteFont>("Content\\Fonts\\TimerFont"); this.z_livesFont = this.z_contentManager.Load<SpriteFont>("Content\\Fonts\\LivesFont"); FloatingText.Initialize(z_contentManager, "Content\\Fonts\\TimerFont"); //Load Achivement Stuff this.z_achivementFail = new GameObject(this.z_contentManager.Load<Texture2D>("Content\\Images\\AchievementFailed")); this.z_achivementFail.IsAlive = false; this.z_achivementFail.Position = new Vector2((z_viewportRec.Width / 2) - (this.z_achivementFail.Sprite.Width / 2), z_viewportRec.Height - 100); this.z_achievementSound = this.z_contentManager.Load<SoundEffect>("Content\\Audio\\SoundFX\\AchievementSound"); //Load the Settings for the MissleManager this.z_missleManager = new MissleManager(this.z_contentManager, this.z_spriteBatch); //Load the Settings for the EnemyManager this.z_enemyManager = EnemyManager.getInstance(this.z_contentManager, this.z_spriteBatch, z_viewportRec); }
public StageManager(SpriteBatch spriteBatch, Rectangle viewPort, ContentManager content) { this.z_isGameOver = false; this.z_spriteBatch = spriteBatch; this.z_viewportRec = viewPort; this.z_contentManager = content; this.z_backgroundManager = new ScrollingBackgroundManager(this.z_viewportRec); this.z_backgroundManager.loadImage1(this.z_contentManager.Load<Texture2D>("Content\\Textures\\spaceBackground")); this.z_backgroundManager.loadImage2(this.z_contentManager.Load<Texture2D>("Content\\Textures\\spaceBackground")); //Set the starting position for player's ship this.z_startingPosition = new Vector2(this.z_viewportRec.Center.X, this.z_viewportRec.Height - 80); //Create the player ship this.z_playerShip = PlayerShip.getInstance(this.z_contentManager.Load<Texture2D>("Content\\Images\\ship1"), this.z_startingPosition); //Set the player alive this.z_playerShip.setIsAlive(true); //Load the Music this.z_MarksSong = this.z_contentManager.Load<Song>("Content\\Audio\\Music\\ATreeFalls"); MediaPlayer.IsRepeating = true; //Load Fonts this.z_timerFont = this.z_contentManager.Load<SpriteFont>("Content\\Fonts\\TimerFont"); this.z_livesFont = this.z_contentManager.Load<SpriteFont>("Content\\Fonts\\LivesFont"); //Load Achivement Stuff this.z_achivementFail = new GameObject(this.z_contentManager.Load<Texture2D>("Content\\Images\\AchievementFailed")); this.z_achivementFail.setPosition(new Vector2((this.z_viewportRec.Width / 2) - (this.z_achivementFail.getSprite().Width / 2), this.z_viewportRec.Height - 100)); this.z_achievementSound = this.z_contentManager.Load<SoundEffect>("Content\\Audio\\SoundFX\\AchievementSound"); //Load the Settings for the asteroidManager this.z_asteroidManager = new AsteroidManager(AsteroidManager.AsteroidManagerState.Lite, this.z_viewportRec, this.z_contentManager, this.z_spriteBatch); //Load the Settings for the MissleManager this.z_missleManager = new MissleManager(this.z_viewportRec, this.z_contentManager, this.z_contentManager.Load<SoundEffect>("Content\\Audio\\SoundFX\\LaserPellet"), this.z_spriteBatch, this.z_playerShip); //Load the Settings for the EnemyManager this.z_enemyManager = EnemyManager.getInstance(this.z_contentManager, this.z_spriteBatch, this.z_viewportRec); }