Ejemplo n.º 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\SpriteSheet");

            comicSansFont = Content.Load <SpriteFont>(@"Fonts\ComicSans");

            starField = new StarField(this.Window.ClientBounds.Width, this.Window.ClientBounds.Height,
                                      200, new Vector2(0, 30f), spriteSheet, new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(10, spriteSheet, new Rectangle(0, 0, 50, 50),
                                                  20, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(spriteSheet, new Rectangle(0, 150, 50, 50), 3,
                                              new Rectangle(0, 0, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(spriteSheet, new Rectangle(0, 200, 50, 50), 6, playerManager,
                                            new Rectangle(0, 0, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(spriteSheet, new Rectangle(0, 100, 50, 50), 3,
                                                    new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(asteroidManager, playerManager, enemyManager, explosionManager);

            SoundManager.Initialize(Content);
        }
 public CollisionManager(AsteroidManager asteroidManager, PlayerManager playerManager, EnemyManager enemyManager, ExplosionManager explosionManager)
 {
     this.asteroidManager  = asteroidManager;
     this.playerManager    = playerManager;
     this.enemyManager     = enemyManager;
     this.explosionManager = explosionManager;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            titleScreen = Content.Load<Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");


            Song song = Content.Load<Song>(@"Sounds\Requiem");  // Put the name of your song in instead of "song_title"
            MediaPlayer.Play(song);


            starField = new StarField(this.Window.ClientBounds.Width,this.Window.ClientBounds.Height,200,
                new Vector2(0, 30f),spriteSheet,new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(10,spriteSheet,new Rectangle(0, 0, 50, 50),20,
                this.Window.ClientBounds.Width,this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(spriteSheet,new Rectangle(0, 150, 50, 50),3,
                new Rectangle(0,0,this.Window.ClientBounds.Width,this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(spriteSheet,new Rectangle(0, 200, 50, 50),6,playerManager,
                new Rectangle(0,0,this.Window.ClientBounds.Width,this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(spriteSheet,new Rectangle(0, 100, 50, 50),3,new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(asteroidManager,playerManager,enemyManager,explosionManager);

            pericles14 = Content.Load<SpriteFont>(@"Fonts\Pericles14");
            // TODO: use this.Content to load your game content here
            SoundManager.Initialize(Content);
        }
Ejemplo n.º 4
0
 public CollisionManager(AsteroidManager asteroidManager, PlayerManager playerManager, EnemyManager enemyManager, ExplosionManager explosionManager)
 {
     this.asteroidManager = asteroidManager;
     this.playerManager = playerManager;
     this.enemyManager = enemyManager;
     this.explosionManager = explosionManager;
 }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            titleScreen     = Content.Load <Texture2D>(@"Textures/TitleScreen");
            spriteSheet     = Content.Load <Texture2D>(@"Textures/SpriteSheet");
            starField       = new StarField(Window.ClientBounds.Width, Window.ClientBounds.Height, 200, new Vector2(0, 30f), spriteSheet, new Rectangle(0, 450, 2, 2));
            asteroidManager = new AsteroidManager(10, spriteSheet, new Rectangle(0, 0, 50, 50), 20, Window.ClientBounds.Width, Window.ClientBounds.Height);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load<Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,    
                new Rectangle(0, 150, 50, 50),    
                3,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 7
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(185, 275, 70, 100),    //Start X Y Width Height
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 8
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            deathStar = Content.Load<Sprite>(@"Textures\DeathStar");
            titleScreen = Content.Load<Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");

            camera = new Camera(new Viewport(0, 0, this.Window.ClientBounds.Width, this.Window.ClientBounds.Height));
            camera.Origin = new Vector2(camera.ViewPort.Width / 2.0f, camera.ViewPort.Height);

            camera.Zoom = 1f;

            


            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,    
                new Rectangle(0, 150, 50, 50),    
                3,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2),
                camera);

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load<SpriteFont>(@"Fonts\Pericles14");
            


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 9
0
 private CollisionManager newCollisionManager(AsteroidManager asteroidManager, PlayerManager playerManager, EnemyManager enemyManager, ExplosionManager explosionManager, PowerupManager powerupManager)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 10
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");
            spaceSheet  = Content.Load <Texture2D>(@"Textures\spaceSheet");


            Song song = Content.Load <Song>(@"Sounds\brawl");  // Put the name of your song here instead of "song_title"

            MediaPlayer.Play(song);

            SpriteCreators.Load(@"Content\SpaceSheet.txt");

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            starField2 = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 25f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            starField3 = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 35f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            planet = new Planets(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                1,
                new Vector2(0, 20f),
                spaceSheet);

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(0, 150, 50, 50),
                3,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 11
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");
            bbb         = Content.Load <Texture2D>(@"Textures\bbb");
            song        = Content.Load <Song>(@"Sounds\song");
            MediaPlayer.Play(song);

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(579, 95, 20, 20));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(354, 68, 62, 54),
                1,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(471, 97, 98, 46),
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(158, 143, 82, 53),
                1,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(158, 143, 82, 53),
                1,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 12
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");

            Song song = Content.Load <Song>(@"Sounds\bangs");  // Put the name of your song in instead of "song_title"

            MediaPlayer.Play(song);


            starFields = new List <StarField>();

            for (int i = 0; i < 8; i++)
            {
                starFields.Add(new StarField(
                                   this.Window.ClientBounds.Width,
                                   this.Window.ClientBounds.Height,
                                   20,
                                   new Vector2(0, 30f + (float)i * 30f),
                                   spriteSheet,
                                   new Rectangle(0, 450, 2, 2)));
            }

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(0, 150, 50, 50),
                3,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 13
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load<Texture2D>(@"Textures/TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures/SpriteSheet");
            pericles14 = Content.Load<SpriteFont>(@"Fonts/Pericles14");
            starField = new StarField(this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                250,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0,450,2,2));
            asteroidManager = new AsteroidManager(10, spriteSheet, new Rectangle(0, 0, 50, 50), 20,
                                                  this.Window.ClientBounds.Width, this.Window.ClientBounds.Height);
            playerManager = new PlayerManager(spriteSheet, new Rectangle(0, 150, 50, 50), 3,
                                              new Rectangle(0, 0, this.Window.ClientBounds.Width,
                                                            this.Window.ClientBounds.Height));
            enemyManager = new EnemyManager(spriteSheet,
                new Rectangle(0,200,50,50),
                6,
                playerManager,
                new Rectangle(
                    0,0,this.Window.ClientBounds.Width, this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(spriteSheet, new Rectangle(0, 100, 50, 50), 3,
                                                    new Rectangle(0, 450, 2, 2));

            collisionmanager = new CollisionManager(asteroidManager, playerManager, enemyManager, explosionManager);
            SoundManager.Initialize(Content);
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            EffectManager.Initialize(this.graphics, this.Content);
            EffectManager.LoadContent();

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");
            planetSheet = Content.Load <Texture2D>(@"Textures\PlanetSheet");
            levelScreen = Content.Load <Texture2D>(@"Textures\LevelSelect");
            ccViewer    = Content.Load <Texture2D>(@"Textures\CheatCodes");
            credits     = Content.Load <Texture2D>(@"Textures\Credits");
            weedBG      = Content.Load <Texture2D>(@"Textures\420");


            planetManager = new PlanetManager(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                new Vector2(0, 40f),
                planetSheet);


            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                10,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(170, 265, 50, 85),
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 15
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");
            planetSheet = Content.Load <Texture2D>(@"Textures\Planets");
            Guydish     = Content.Load <Texture2D>(@"Textures\Guydish");
            Winner      = Content.Load <Texture2D>(@"Textures\Winner");
            Boss        = Content.Load <Texture2D>(@"Textures\Boss");

            planetManager = new PlanetManager(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                new Vector2(0, 40f),
                planetSheet);


            starFields = new List <StarField>();

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               50,
                               new Vector2(0, 40f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               150,
                               new Vector2(0, 30f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               150,
                               new Vector2(0, 15f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               50,
                               new Vector2(0, 5f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            asteroidManager = new AsteroidManager(
                5,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(7, 146, 62, 62),
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            bossManager = new BossManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 16
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen    = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet    = Content.Load <Texture2D>(@"Textures\spriteSheet");
            crossHairsheet = Content.Load <Texture2D>(@"Textures\Crosshair2");

            crosshair = new Sprite(new Vector2(0, 0), crossHairsheet, new Rectangle(0, 0, 48, 48), Vector2.Zero);
            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(0, 150, 50, 50),
                3,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            gunManager = new GunManager();

            SoundManager.Initialize(Content);
            EffectManager.Initialize(graphics, Content);
            EffectManager.LoadContent();

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 17
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");
            SuperSprite = Content.Load <Texture2D>(@"Textures\SuperSprite");
            krypton     = Content.Load <Texture2D>(@"Textures\krypton");

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 8, 8));

            starField1 = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 4, 4));

            starField2 = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 8, 8));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                SuperSprite,
                new Rectangle(0, 0, 51, 64),
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 18
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            HomeScreen = Content.Load<Texture2D>(@"Textures\HomeScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                14,
                spriteSheet,
                new Rectangle(472, 208, 52, 49),
                1,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,    
                new Rectangle(0, 326, 50, 100),    
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(316, 210, 46, 46),
                1,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load<SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 19
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load<Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");
            planetsmash = Content.Load<Texture2D>(@"Textures\planetsmash");

            starField = new List<StarField>();
            background = new Sprite(new Vector2(0, 0), planetsmash, new Rectangle(0, 0, 800, 600), Vector2.Zero);

            starField.Add(new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                50,
                new Vector2(0, 5f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2)));

            starField.Add(new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 10f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2)));

            starField.Add(new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 20f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2)));

            starField.Add(new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2)));

            starField.Add(new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                25,
                new Vector2(0, 60f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2)));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(0, 150, 50, 50),
                3,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load<SpriteFont>(@"Fonts\Pericles14");

            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 20
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load<Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");
            SuperSprite = Content.Load<Texture2D>(@"Textures\SuperSprite");
            krypton = Content.Load<Texture2D>(@"Textures\krypton");

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 8, 8));

            starField1 = new StarField(
               this.Window.ClientBounds.Width,
               this.Window.ClientBounds.Height,
               200,
               new Vector2(0, 30f),
               spriteSheet,
               new Rectangle(0, 450, 4, 4));

            starField2 = new StarField(
               this.Window.ClientBounds.Width,
               this.Window.ClientBounds.Height,
               200,
               new Vector2(0, 30f),
               spriteSheet,
               new Rectangle(0, 450, 8, 8));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                SuperSprite,    
                new Rectangle(0, 0, 51, 64),    
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load<SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 21
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load<Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");
            bbb = Content.Load<Texture2D>(@"Textures\bbb");
            song = Content.Load<Song>(@"Sounds\song");
            MediaPlayer.Play(song);

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                100,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(579, 95, 20, 20));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(354, 68, 62, 54),
                1,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,    
                new Rectangle(471, 97, 98, 46),    
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(158, 143, 82, 53),
                1,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(158, 143, 82, 53),
                1,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load<SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 22
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            HomeScreen  = Content.Load <Texture2D>(@"Textures\HomeScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");

            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                14,
                spriteSheet,
                new Rectangle(472, 208, 52, 49),
                1,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(0, 326, 50, 100),
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(316, 210, 46, 46),
                1,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 23
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            titleScreen = Content.Load<Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load<Texture2D>(@"Textures\spriteSheet");
            laserpowerup = Content.Load<Texture2D>(@"Textures\laserpowerup");
            Blackhole = Content.Load<Texture2D>(@"Textures\Blackhole");

            starField = new List<StarField>();

            for (int i = 0; i < 5; i++)
            {
                starField.Add( new StarField(
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height,
                    200,
                    new Vector2(0, 30f * (float)i),
                    spriteSheet,
                    new Rectangle(0, 450, 2, 2)) );
            }

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(0, 150, 50, 50),
                3,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            powerupManager = new PowerupManager(laserpowerup, Blackhole, playerManager);

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager,
                powerupManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load<SpriteFont>(@"Fonts\Pericles14");

            // TODO: use this.Content to load your game content here
        }