Ejemplo n.º 1
0
 //The Cunstructor
 public CollisionsManager(PlayerManager playerSprite, ExplosionManager explosionManager, EnemyManager enemyManager) //int playerLife
 {
     this.playerManager    = playerSprite;
     this.explosionManager = explosionManager;
     this.enemyManager     = enemyManager;
     //this.playerLife = playerLife;
 }
Ejemplo n.º 2
0
        //Load content here
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);


            //Loads Mixed sprites
            mixedSprites = Content.Load <Texture2D>(@"Images/Mixed");
            //Loads Starfiedls star texture
            starField = new Starfield
                            (this.Window.ClientBounds.Width, this.Window.ClientBounds.Height, 200, new Vector2(0, 500f), mixedSprites, new Rectangle(0, 288, 2, 2));

            Rectangle screenBounds = new Rectangle(0, 0, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height);

            //Loads and locates Player spite from Mixed sprites
            playerSprite = new PlayerManager(Content.Load <Texture2D>(@"Images/mixed"), 1, 32, 48, screenBounds);
            //Loads but also declares playerSprite position
            playerSprite.Position = new Vector2(400, 300);

            //Loads and locates Enemt sprite from Mixed sprites
            enemyManager = new EnemyManager(mixedSprites, new Rectangle(0, 55, 32, 50), 4, playerSprite, screenBounds);

            enemyManager2 = new EnemyManager2(mixedSprites, new Rectangle(0, 110, 32, 50), 4, playerSprite, screenBounds);

            //Loads Explosion sprite from mixed sprites
            explosionManager = new ExplosionManager(mixedSprites, new Rectangle(0, 100, 50, 50), 3, new Rectangle(0, 450, 2, 2));
            //Loads Collision properties
            collisionManager = new CollisionsManager(playerSprite, explosionManager, enemyManager);

            //Loads Background Image from images
            backgroundImage = new BackgroundManager(Content.Load <Texture2D>(@"Images/HWB"));
            //Loads Background2 Image from images
            backgroundImage2 = new BackgroundManager2(Content.Load <Texture2D>(@"Images/HWB"));
            collisionManager = new CollisionsManager(playerSprite, explosionManager, enemyManager);
            //
            CreditsBG  = new CreditsManager(Content.Load <Texture2D>(@"images/CreditsBG"));
            CreditsBG2 = new CreditsManager2(Content.Load <Texture2D>(@"images/CreditsBG2"));

            #region Background
            // BG = BackGround you need to change here
            TutorialBG = Content.Load <Texture2D>(@"Images/TutorialBG");
            GameoverBG = Content.Load <Texture2D>(@"Images/Gameover");
            #endregion

            RobotoRegular36 = Content.Load <SpriteFont>(@"Font/Roboto/Normal");
            RobotoBold36    = Content.Load <SpriteFont>(@"Font/Roboto/Bold");

            Logo = Content.Load <Texture2D>(@"Images/Logo");
        }