Beispiel #1
0
        public EnemyController(Texture2D spriteSheet, Texture2D bossSheet)
        {
            Instance = this;

            _spriteSheet = spriteSheet;
            _bossSheet = bossSheet;

            Enemies = new List<Enemy>();
            BoxCollidesWith = new List<object>();
            PolyCollidesWith = new List<object>();
        }
Beispiel #2
0
        public override void LoadContent()
        {
            ContentManager content = ScreenManager.Game.Content;

            map = content.Load<Map>("map");
            MapGeneration.Generate(map);

            camera = new Camera(ScreenManager.Game.RenderWidth, ScreenManager.Game.RenderHeight, map);

            //camera.Zoom = 0.5f;

            text = content.Load<Texture2D>("titles");

            hud = new HUD(content.Load<Texture2D>("hud"));

            waterLevel = ScreenManager.Game.RenderHeight;
            waterParallax = new Parallax(content.Load<Texture2D>("abovewater-parallax"), 12, 0.5f, waterLevel, (map.TileWidth * map.Width), new Viewport(0, 0, ScreenManager.Game.RenderWidth, ScreenManager.Game.RenderHeight), false, true);
            underwaterBGParallax = new Parallax(content.Load<Texture2D>("underwater-bg"), 4, 1f, waterLevel + 20, (map.TileWidth * map.Width), new Viewport(0, 0, ScreenManager.Game.RenderWidth, ScreenManager.Game.RenderHeight), true, false);
            skyBGParallax = new Parallax(content.Load<Texture2D>("sky-bg"), 72, 1f, 70, (map.TileWidth * map.Width), new Viewport(0, 0, ScreenManager.Game.RenderWidth, ScreenManager.Game.RenderHeight), false, false);
            rocksParallax = new Parallax(content.Load<Texture2D>("seabed-rocks"), 16, 0.35f, (map.TileHeight*map.Height) -15, (map.TileWidth * map.Width), new Viewport(0, 0, ScreenManager.Game.RenderWidth, ScreenManager.Game.RenderHeight), false, false);
            cloudsParallax = new Parallax(content.Load<Texture2D>("clouds"), 16, 0.35f, 25, (map.TileWidth * map.Width), new Viewport(0, 0, ScreenManager.Game.RenderWidth, ScreenManager.Game.RenderHeight), false, false, true);

            playerShip = new Ship(content.Load<Texture2D>("playership"), new Rectangle(0,0,10,10), null, Vector2.Zero);
            playerShip.Position = new Vector2(64, 190);

            particleController.LoadContent(content);

            projectileController = new ProjectileController(1000, sheet => new Projectile(sheet, new Rectangle(0, 0, 4, 4), null, new Vector2(0, 0)) , content.Load<Texture2D>("projectiles"));
            enemyController = new EnemyController(content.Load<Texture2D>("enemies"), content.Load<Texture2D>("boss"));
            powerupController = new PowerupController(1000,sheet => new Powerup(sheet, new Rectangle(0, 0, 6, 6), null, Vector2.Zero),content.Load<Texture2D>("powerup"));

            powerupController.BoxCollidesWith.Add(playerShip);
            projectileController.BoxCollidesWith.Add(playerShip);
            projectileController.BoxCollidesWith.Add(enemyController);
            projectileController.BoxCollidesWith.Add(projectileController);
            enemyController.BoxCollidesWith.Add(playerShip);
            enemyController.BoxCollidesWith.Add(projectileController);

            GameController.Reset();

            //enemyController.SpawnInitial(GameController.Wave, map);

            base.LoadContent();
        }