Exemple #1
0
 public TitleScreen(GameManager gameManager)
 {
     this.spriteBatch  = gameManager.spriteBatch;
     this.gameContent  = gameManager.gameContent;
     this.screenHeight = gameManager.screenHeight;
     this.screenWidth  = gameManager.screenWidth;
     imgTitle          = gameContent.imgTitle;
 }
Exemple #2
0
 public EndingScreen(GameManager gameManager)
 {
     this.spriteBatch  = gameManager.spriteBatch;
     this.gameContent  = gameManager.gameContent;
     this.screenHeight = gameManager.screenHeight;
     this.screenWidth  = gameManager.screenWidth;
     imgGameOver       = gameContent.imgGameOver;
 }
Exemple #3
0
        public GameContent(ContentManager Content)
        {
            instance = this;

            labelFont          = Content.Load <SpriteFont>("Fonts/Arial20");
            imgTitle           = Content.Load <Texture2D>("Sprites/Title");
            imgFireFly         = Content.Load <Texture2D>("Sprites/powerupfirefly");
            imgGameOver        = Content.Load <Texture2D>("Sprites/gameoverscreen");
            imgPlusFruit       = Content.Load <Texture2D>("Sprites/powerupfruit");
            foregroundTexture  = Content.Load <Texture2D>("Sprites/newSight");
            blacksmall         = Content.Load <Texture2D>("Sprites/black");
            redheart           = Content.Load <Texture2D>("Sprites/redheart");
            sadheart           = Content.Load <Texture2D>("Sprites/sadheart");
            imgEcho            = Content.Load <Texture2D>("Sprites/Echo");
            imgStalagmite1     = Content.Load <Texture2D>("Sprites/obstacle1");
            imgStalagmite2     = Content.Load <Texture2D>("Sprites/obstacle2");
            imgStalactite1     = Content.Load <Texture2D>("Sprites/flippedobstacle1");
            imgStalactite2     = Content.Load <Texture2D>("Sprites/flippedobstacle2");
            imgfloatingRock    = Content.Load <Texture2D>("Sprites/obstacle3");
            imgfloatingTangles = Content.Load <Texture2D>("Sprites/obstacle4");
            songbg             = Content.Load <Song>("SoundEffects/bgsound");
            songTitle          = Content.Load <Song>("SoundEffects/Echo Title Screen");
            // TODO: replace the files when new sound effects were added
            echoCast        = Content.Load <SoundEffect>("SoundEffects/echolocation01");
            echoHitObsticle = Content.Load <SoundEffect>("SoundEffects/BrickSound");
            slowSound       = Content.Load <SoundEffect>("SoundEffects/slow");
            fireflypickup   = Content.Load <SoundEffect>("SoundEffects/fireflypickup");
            fruitpickup     = Content.Load <SoundEffect>("SoundEffects/fruitpickup");

            blackEchoList = new List <Texture2D>();
            for (var i = 0; i < 3; i++)
            {
                var index       = i + 1;
                var currentEcho = Content.Load <Texture2D>("Sprites/black0" + index);
                blackEchoList.Add(currentEcho);
            }

            batList = new List <Texture2D>();
            for (var i = 0; i < 4; i++)
            {
                var index      = i + 1;
                var currentBat = Content.Load <Texture2D>("Sprites/bat0" + index);
                batList.Add(currentBat);
            }
        }
Exemple #4
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            gameContent  = new GameContent(Content);
            screenWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            if (screenWidth >= 1275)
            {
                screenWidth = 1275;
            }
            if (screenHeight >= 725)
            {
                screenHeight = 725;
            }
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            graphics.ApplyChanges();

            player         = new Player(200.0f, 100.0f, this);
            titleScreen    = new TitleScreen(this);
            scoreManager   = new Scoremanager(this);
            gameOverScreen = new EndingScreen(this);
            backGround     = new RollingBackGround();
            backGround.Load(spriteBatch, gameContent);

            MediaPlayer.Play(gameContent.songbg);

            MediaPlayer.MediaStateChanged += MediaPlayer_MediaStateChanged;

            //obstacle code!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            obstacleSpawner   = new ObstacleSpawner(50, screenWidth, screenWidth - 100, screenHeight - 100, -200, 700, 200, 9, this);
            consumableSpawner = new ConsumableSpawner(20, screenWidth, screenWidth - 100, screenHeight - 50, 50, 750, 250, 5, this);

            soundEffects.Add(Content.Load <SoundEffect>("wings"));
            soundEffects.Add(Content.Load <SoundEffect>("hit01"));
        }
Exemple #5
0
        public GameContent(ContentManager Content)
        {
            instance = this;

            echoAmb           = Content.Load <SoundEffect>("SoundEffects/echoAmb");
            labelFont         = Content.Load <SpriteFont>("Fonts/Arial20");
            imgTitle          = Content.Load <Texture2D>("Sprites/Title");
            imgFireFly        = Content.Load <Texture2D>("Sprites/powerupfirefly");
            imgGameOver       = Content.Load <Texture2D>("Sprites/gameoverscreen");
            imgPlusFruit      = Content.Load <Texture2D>("Sprites/powerupfruit");
            foregroundTexture = Content.Load <Texture2D>("Sprites/newSight");
            blacksmall        = Content.Load <Texture2D>("Sprites/black");
            redheart          = Content.Load <Texture2D>("Sprites/redheart");
            imgStag           = Content.Load <Texture2D>("Sprites/vertbrick");
            imgStalagmite1    = Content.Load <Texture2D>("Sprites/obstacle1");
            imgStalagmite2    = Content.Load <Texture2D>("Sprites/obstacle2");
            imgStalactite1    = Content.Load <Texture2D>("Sprites/flippedobstacle1");
            imgStalactite2    = Content.Load <Texture2D>("Sprites/flippedobstacle2");
            imgfloatingRock   = Content.Load <Texture2D>("Sprites/obstacle3");
            songbg            = Content.Load <Song>("SoundEffects/bgsound");

            blackEchoList = new List <Texture2D>();
            for (var i = 0; i < 3; i++)
            {
                var index       = i + 1;
                var currentEcho = Content.Load <Texture2D>("Sprites/black0" + index);
                blackEchoList.Add(currentEcho);
            }

            batList = new List <Texture2D>();
            for (var i = 0; i < 4; i++)
            {
                var index      = i + 1;
                var currentBat = Content.Load <Texture2D>("Sprites/bat0" + index);
                batList.Add(currentBat);
            }
        }
Exemple #6
0
 public void Load(SpriteBatch spriteBatch, GameContent content)
 {
     this.spriteBatch  = spriteBatch;
     backgroundTexture = content.foregroundTexture;
     windowSize        = spriteBatch.GraphicsDevice.PresentationParameters.Bounds.Size;
 }