Beispiel #1
0
 public CollisionManager(PlayerManager playerManager,
                         EnemyManager enemyManager,
                         ExplosionManager explosionManager, PowerupLife life)
 {
     // TODO: Complete member initialization
     this.playerManager    = playerManager;
     this.enemyManager     = enemyManager;
     this.explosionManager = explosionManager;
     this.life             = life;
 }
Beispiel #2
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);

            //playerinfo = Content.Load<PlayerInfo[]>(@"Content/playerdata");

            titleScreen      = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet      = Content.Load <Texture2D>(@"Textures\SpriteSheet");
            spriteSheet1     = Content.Load <Texture2D>(@"Textures\SpriteSheet1");
            Enemies          = Content.Load <Texture2D>(@"Textures\Enemies");
            explosionTexture = Content.Load <Texture2D>(@"Textures\explosion");
            ShieldTexture    = Content.Load <Texture2D>(@"Textures\ShieldTexture");
            pericles14       = Content.Load <SpriteFont>(@"Fonts\Pericles14");

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

            playerManager = new PlayerManager(
                spriteSheet1, new Rectangle(
                    0, 0, 48, 48), 2,
                new Rectangle(0, 0,
                              this.Window.ClientBounds.Width,
                              this.Window.ClientBounds.Height), null);


            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));

            life = new PowerupLife(
                Enemies, new Rectangle(160, 550, 15, 15),
                13, new Rectangle(0, 0,
                                  this.Window.ClientBounds.Width,
                                  this.Window.ClientBounds.Height));

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


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