public void setArrow(GameObject newArrow)
 {
     this.z_arrow = newArrow;
 }
 //Required Load Method
 public void loadTexture(ContentManager content)
 {
     this.z_logo = content.Load<Texture2D>("Content\\Screens\\LogoScreen");
     this.z_options = content.Load<Texture2D>("Content\\Screens\\TitleOptions3");
     this.z_arrow = new GameObject(content.Load<Texture2D>("Content\\Screens\\ArrowSelection"));
     //Try to fiqure the starting position for arrow ^^
     this.z_arrow.setPosition(new Vector2((float)((this.z_viewPort.Width / 2) - 170), (float)(this.z_viewPort.Height / 2)+50));
     this.z_isLoaded = true;
 }
Пример #3
0
 public static void AddObject(GameObject obj)
 {
     z_objects.Add(obj);
 }
Пример #4
0
        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);
        }