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

            background    = new graphics2d(Content, "fullmoon", displaywidth, displayheight);
            gameoverimage = new graphics2d(Content, "gameover", displaywidth, displayheight);

            for (int i = 0; i < numberofballs; i++)
            {
                float tempsize = (float)(randomiser.Next(100) + 1) * ballsizeratio;
                if (tempsize < miniballsize)
                {
                    tempsize = miniballsize;
                }

                balls[i] = new sprites2d(Content, "ast1", displaywidth / 2, displayheight / 2, tempsize,
                                         new Color((byte)randomiser.Next(255), (byte)randomiser.Next(255), (byte)randomiser.Next(255)), true, randomiser);
            }
            collidesound    = Content.Load <SoundEffect>("rocks");
            soundtrack1     = Content.Load <SoundEffect>("explosive_attack");
            music1          = soundtrack1.CreateInstance();
            music1.IsLooped = true;
            music1.Volume   = 0.5f;
            soundtrack2     = Content.Load <SoundEffect>("iron-man");
            music2          = soundtrack2.CreateInstance();
            music2.IsLooped = true;
            music2.Volume   = 0.5f;
            mainfont        = Content.Load <SpriteFont>("quartz4");



            reset();
        }
Exemple #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);

            backgscroll   = new scrollingbackground(Content, "space", 1, 5, 5);
            gameoverimage = new graphics2d(Content, "gameover", displaywidth, displayheight);

            for (int i = 0; i < numberofballs; i++)
            {
                float tempsize = (float)(randomiser.Next(100) + 1) * ballsizeratio;
                if (tempsize < miniballsize)
                {
                    tempsize = miniballsize;
                }

                balls[i] = new sprites2d(Content, "ast1", displaywidth / 2, displayheight / 2, tempsize,
                                         new Color((byte)randomiser.Next(255), (byte)randomiser.Next(255), (byte)randomiser.Next(255)), true, randomiser);
            }
            collidesound    = Content.Load <SoundEffect>("rocks");
            soundtrack1     = Content.Load <SoundEffect>("explosive_attack");
            music1          = soundtrack1.CreateInstance();
            music1.IsLooped = true;
            music1.Volume   = 0.5f;
            soundtrack2     = Content.Load <SoundEffect>("iron-man");
            music2          = soundtrack2.CreateInstance();
            music2.IsLooped = true;
            music2.Volume   = 0.5f;
            mainfont        = Content.Load <SpriteFont>("quartz4");

            for (int i = 0; i < numberofballs; i++)
            {
                explosion[i] = new animation(Content, "effect_005", 0, 0, 1f, Color.White, false, 24, 4, 5, false);
            }

            shiphit[0] = new animation(Content, "effect_003", 0, 0, 1, Color.White, false, 24, 5, 5, false);
            shiphit[1] = new animation(Content, "effect_002", 0, 0, 1, Color.White, false, 24, 4, 5, false);

            bullet[0] = new ammo(Content, "bullet1", 0, 0, .1f, Color.White, false);
            bullet[1] = new ammo(Content, "bullet2", 0, 0, .1f, Color.White, false);

            for (int b = 0; b < numberofbullets; b++)
            {
                for (int s = 0; s < numberofships; s++)
                {
                    bullets5[s, b] = new ammo(Content, "bullet2", 0, 0, .1f, Color.White, false);
                }
            }

            reset();
        }
Exemple #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);

            if (File.Exists(@"highscore.txt"))
            {
                String       line;
                StreamReader sr = new StreamReader(@"highscore.txt");
                line = sr.ReadLine();

                line = line.Trim();
                for (int i = 0; i < numberofhighscores & !sr.EndOfStream; i++)
                {
                    highscores[i] = Convert.ToInt32(line);
                }

                sr.Close();
            }

            background    = new graphics2d(Content, "Background for Menus", displaywidth, displayheight);
            mousepointer1 = new sprites2d(Content, "X-Games-Cursor", 0, 0, 0.15f, Color.White, true, randomiser);
            mousepointer2 = new sprites2d(Content, "X-Games-Cursor-Highlight", 0, 0, 0.15f, Color.White, true, randomiser);

            menuoptions[0, 0] = new sprites2d(Content, "Start-Normal", displaywidth / 2, 200, 1, Color.White, true, randomiser);
            menuoptions[0, 1] = new sprites2d(Content, "Start-Selected", displaywidth / 2, 200, 1, Color.White, true, randomiser);
            menuoptions[1, 0] = new sprites2d(Content, "Options-Normal", displaywidth / 2, 300, 1, Color.White, true, randomiser);
            menuoptions[1, 1] = new sprites2d(Content, "options-Selected", displaywidth / 2, 300, 1, Color.White, true, randomiser);
            menuoptions[2, 0] = new sprites2d(Content, "High-Score-Normal", displaywidth / 2, 400, 1, Color.White, true, randomiser);
            menuoptions[2, 1] = new sprites2d(Content, "High-Score-Selected", displaywidth / 2, 400, 1, Color.White, true, randomiser);
            menuoptions[3, 0] = new sprites2d(Content, "Exit-Normal", displaywidth / 2, 500, 1, Color.White, true, randomiser);
            menuoptions[3, 1] = new sprites2d(Content, "Exit-Selected", displaywidth / 2, 500, 1, Color.White, true, randomiser);

            for (int i = 0; i < numberofoptions; i++)
            {
                menuoptions[i, 0].updateobject();
            }

            mainfont = Content.Load <SpriteFont>("mainfont");
        }
Exemple #4
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);

            background = new graphics2d(Content, "fullmoon", displaywidth, displayheight);
            gameoverimage = new graphics2d(Content, "gameover", displaywidth, displayheight);

            football = new sprites2d(Content, "football2", displaywidth / 2, displayheight / 2, 0.2f, Color.Tomato, true);

            mainfont = Content.Load<SpriteFont>("quartz4");

            reset();
        }