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

            // load sprites and such
            playerSprite = Content.Load<Texture2D>("playership");
            playerBulletSprite = Content.Load<Texture2D>("playerbullet");

            starTex = new Texture2D[3];
            starTex[0] = Content.Load<Texture2D>("star1");
            starTex[1] = Content.Load<Texture2D>("star2");
            starTex[2] = Content.Load<Texture2D>("star3");

            backTex = new Texture2D[4];
            backTex[0] = Content.Load<Texture2D>("background1");
            backTex[1] = Content.Load<Texture2D>("background2");
            backTex[2] = Content.Load<Texture2D>("background3");
            backTex[3] = Content.Load<Texture2D>("background4");

            earthTex = Content.Load<Texture2D>("earth");

            enemySprites = new Texture2D[4];
            enemySprites[0] = Content.Load<Texture2D>("enemy1");
            enemySprites[1] = Content.Load<Texture2D>("enemy2");
            enemySprites[2] = Content.Load<Texture2D>("enemy3");
            enemySprites[3] = Content.Load<Texture2D>("boss");

            eggSprite = Content.Load<Texture2D>("egg");
            hollowEggSprite = Content.Load<Texture2D>("hollowegg");
            portalSprite = Content.Load<Texture2D>("portal");

            HPBoxSprite = Content.Load<Texture2D>("hpbox");

            arrowSprite = Content.Load<Texture2D>("arrow");
            sparkSprite = Content.Load<Texture2D>("spark");
            explosionSprite = Content.Load<Texture2D>("explosion");

            levelManager = new LevelManager(starTex, backTex, earthTex);

            player = new Player(playerSprite, new Vector2(0.0f, 0.0f),
                new Vector2(0.0f, 0.0f), 200, levelManager);
            characterManager = new CharacterManager(player);
            inputHandler = new InputHandler(player);

            player.setCharacterManager(characterManager);
            levelManager.setCharacterManager(characterManager);

            characterManager.setBulletSprite(playerBulletSprite);
            characterManager.setEnemySprites(enemySprites);
            characterManager.setEggSprite(eggSprite);
            characterManager.setPortalSprite(portalSprite);
            characterManager.setArrowSprite(arrowSprite);
            characterManager.setExplosionSprite(explosionSprite);
            characterManager.setSparkSprite(sparkSprite);
            characterManager.setLevelManager(levelManager);

            cam = new Camera(GraphicsDevice, new Vector2(0.0f, 0.0f), player, levelManager);
            characterManager.setCam(cam);

            soundManager = new SoundManager(Content);
            levelManager.setSoundManager(soundManager);
            characterManager.setSoundManager(soundManager);

            font = Content.Load<SpriteFont>("font");

            intro = new string[6];
            intro[0] = "This is ground control... your circuit's dead, there's something wrong...\n\n\n";
            intro[1] = "On a routine mission, you stumble into a strange portal and find yourself";
            intro[2] = "-alone-";
            intro[3] = "in a parallel dimension.";
            intro[4] = "Search for the space eggs to survive and find your way home.";
            intro[5] = "Good luck !";

            end = new string[4];
            end[0] = "In your absence, the earth was destroyed.";
            end[1] = "You are now";
            end[2] = "-alone-";
            end[3] = "\n\nTHE END";

            gameOver = false;

            levelManager.initLevel(0);
            Game1.points = 0;
        }
Esempio n. 2
0
 public void setCam(Camera c)
 {
     cam = c;
 }