コード例 #1
0
        public EnemyBullet(ContentManager Content, WindowWidth WindowWidth, int WindowHeight)
        {
            m_WindowWidth  = WindowWidth;
            m_WindowHeight = WindowHeight;

            //sound file
            Sound_FireGun = Content.Load <SoundEffect>("Sound Files/Shoot").CreateInstance();
        }
コード例 #2
0
        //constructor FOR ROOM3
        public Testing_room3(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //Lists
            m_Rocks = new List <Rock>();

            //sets the spawn location
            player.position = player.GenericSPWN;

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //Textures
            var texBox   = Content.Load <Texture2D>("Textures/Box");
            var texPlate = Content.Load <Texture2D>("Textures/Pressure Plate");
            var texrock  = Content.Load <Texture2D>("Textures/Rock");

            //Box
            m_Box = new Box(Content, m_windowwidth, m_windowheight);
            m_Box.LoadContent(texBox,
                              m_Box.SpawnPos);

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(0, m_windowheight - m_Newspaper.texNewspaper.Height));

            //pressure plate
            m_PressurePlate = new PressurePlate();
            m_PressurePlate.LoadContent(texPlate,
                                        new Vector2(m_windowwidth.Val - texPlate.Width * 3, m_windowheight - texPlate.Height * 2));

            //rock
            var rock = new Rock();

            rock.LoadContent(texrock, new Vector2(texPlate.Width, 0));
            m_Rocks.Add(rock);

            //rock
            rock = new Rock();
            rock.LoadContent(texrock, new Vector2(m_windowwidth.Val - texrock.Width * 1.9f, texrock.Height));
            m_Rocks.Add(rock);

            //rock
            rock = new Rock();
            rock.LoadContent(texrock, new Vector2(0, 400));
            m_Rocks.Add(rock);

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(2);
        }
コード例 #3
0
        public Gun(ContentManager Content, WindowWidth WindowWidth, int WindowHeight)
        {
            m_content      = Content;
            m_WindowWidth  = WindowWidth;
            m_WindowHeight = WindowHeight;

            //Texture
            texGun = Content.Load <Texture2D>("Textures/Gun");
        }
コード例 #4
0
        public Limb(ContentManager Content, WindowWidth ScreenWidth, int ScreenHeight)
        {
            m_content      = Content;
            m_ScreenWidth  = ScreenWidth;
            m_ScreenHeight = ScreenHeight;

            //loads in the texture from the pipeline
            tex = Content.Load <Texture2D>("Limb");
        }
コード例 #5
0
        public Button(ContentManager Content, WindowWidth ScreenWidth)
        {
            m_content     = Content;
            m_ScreenWidth = ScreenWidth;

            texButton = Content.Load <Texture2D>("Button");

            m_OpenDoor = Content.Load <SoundEffect>("Sound Files/Open");
        }
コード例 #6
0
        public Player(ContentManager Content, WindowWidth m_windowwidth, int m_windowheight)
        {
            m_content      = Content;
            m_ScreenWidth  = m_windowwidth;
            m_ScreenHeight = m_windowheight;

            //Gives the player a generic spawn that can be used in multiple levels
            GenericSPWN = new Vector2(m_windowwidth.Val / 2, m_windowheight - 200);
        }
コード例 #7
0
        //constructor for the first room
        public Testing_room(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //sets the spawn location
            player.position = player.GenericSPWN;

            //allows the player to move when room loads
            player.GiveLife();

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //Textures
            var texBullet = Content.Load <Texture2D>("Bullet");

            //gun
            m_Gun = new Gun(Content, m_windowwidth, m_windowheight);
            m_Gun.LoadContent(m_Gun.texGun,
                              new Vector2(m_windowwidth.Val / 2 - m_Gun.texGun.Width / 2, m_windowheight / 2 - m_Gun.texGun.Height / 2));

            //button
            m_Button = new Button(Content, m_windowwidth);
            m_Button.LoadContent(m_Button.texButton,
                                 new Vector2(m_windowwidth.Val / 2 - m_Button.texButton.Width / 2, 0));

            //bullet
            m_Bullet = new Bullet(Content, m_windowwidth, m_windowheight);
            m_Bullet.LoadContent(texBullet,
                                 new Vector2(m_windowwidth.Val - 100));

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(0, m_windowheight - m_Newspaper.texNewspaper.Height));

            //666
            m_666 = new _666(Content, m_windowwidth, m_windowheight);
            m_666.LoadContent(m_666.Texture,
                              new Vector2(m_windowwidth.Val - m_windowwidth.Val / 4, m_windowheight / 6));

            //limb
            m_Limb = new Limb(Content, m_windowwidth, m_windowheight);
            m_Limb.LoadContent(m_Limb.Texture,
                               new Vector2(m_windowwidth.Val - m_windowwidth.Val / 5, m_windowheight / 4));

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(0);
        }
コード例 #8
0
        public Box(ContentManager Content, WindowWidth WindowWidth, int WindowHeight)
        {
            m_content      = Content;
            m_WindowWidth  = WindowWidth;
            m_WindowHeight = WindowHeight;

            //spawn pos for box
            SpawnPos = new Vector2(m_WindowWidth.Val / 2, m_WindowHeight / 2);

            //Loads the sound file for from the content pipeline
            Wrong = Content.Load <SoundEffect>("Sound Files/Wrong");
        }
コード例 #9
0
        //constructor FOR ROOM2
        public Enemy(ContentManager Content, WindowWidth windowwidth, int windowheight)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            var ExplodeAnimation = Content.Load <Texture2D>("Textures/ExplosionAnim");

            //animated explostion
            anim_Explode = new ExplosionAnimation(ExplodeAnimation);
        }
コード例 #10
0
        //constructor FOR ROOM2
        public Testing_room8(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //sets the players position to the rooms spawn loaction
            player.position = player.GenericSPWN;

            //Textures
            var texEnemy  = Content.Load <Texture2D>("Enemy");
            var texBullet = Content.Load <Texture2D>("Bullet");

            //enemy
            m_Enemy = new Enemy(Content, m_windowwidth, m_windowheight);
            m_Enemy.LoadContent(texEnemy,
                                new Vector2(m_windowwidth.Val - texEnemy.Width, 0));

            //gun
            m_Gun = new Gun(Content, m_windowwidth, m_windowheight);
            m_Gun.LoadContent(m_Gun.texGun, player.position);

            //bullet
            m_Bullet = new Bullet(Content, m_windowwidth, m_windowheight);
            m_Bullet.LoadContent(texBullet,
                                 new Vector2(m_windowwidth.Val - 100));

            //enemy bullet
            m_EnemyBullet = new EnemyBullet(Content, m_windowwidth, m_windowheight);
            m_EnemyBullet.LoadContent(texBullet,
                                      new Vector2(m_windowwidth.Val - 100));

            //button
            m_Button = new Button(Content, m_windowwidth);
            m_Button.LoadContent(m_Button.texButton,
                                 new Vector2(m_windowwidth.Val / 2 - m_Button.texButton.Width / 2, 0));

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(0, m_windowheight - m_Newspaper.texNewspaper.Height));

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(7);
        }
コード例 #11
0
        public ControlsRoom(ContentManager Content, WindowWidth windowwidth, int windowheight, GraphicsDeviceManager graphics)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;
            m_graphics     = graphics;

            //loads the image
            image = Content.Load <Texture2D>("Textures/Controls Page");

            //loads the sound effect
            Sound_MouseClick = Content.Load <SoundEffect>("Sound Files/Click");
        }
コード例 #12
0
        //constructor FOR ROOM5
        public Testing_room5(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //sets the spawn location
            player.position = player.GenericSPWN;

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //loads the list of arrows
            m_Arrows = new List <Arrow>();

            //Arrow1
            var arrowTex = Content.Load <Texture2D>("Textures/Arrow");

            var arrow = new Arrow(m_windowwidth);

            arrow.LoadContent(arrowTex, new Vector2(0, 0));
            m_Arrows.Add(arrow);

            arrow = new Arrow(m_windowwidth);
            arrow.LoadContent(arrowTex,
                              new Vector2(m_windowwidth.Val, m_windowheight / 2 - arrowTex.Width));
            m_Arrows.Add(arrow);

            arrow = new Arrow(m_windowwidth);
            arrow.LoadContent(arrowTex, new
                              Vector2(m_windowwidth.Val / 2 - arrowTex.Width / 2, m_windowheight / 2));
            m_Arrows.Add(arrow);

            //button
            m_Button = new Button(Content, m_windowwidth);
            m_Button.LoadContent(m_Button.texButton,
                                 new Vector2(m_windowwidth.Val / 2 - m_Button.texButton.Width / 2, 0));

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(0, m_windowheight - m_Newspaper.texNewspaper.Height));

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(4);
        }
コード例 #13
0
        //constructor FOR ROOM2
        public Testing_room2(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //sets the spawn location
            player.position = player.GenericSPWN;

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //Textures
            var texGun    = Content.Load <Texture2D>("Gun");
            var texBullet = Content.Load <Texture2D>("Bullet");
            var texBlood  = Content.Load <Texture2D>("Textures/StaticBlood");

            //Blood
            m_Blood = new Blood();
            m_Blood.LoadContent(texBlood,
                                new Vector2(m_windowwidth.Val - texBlood.Width, m_windowheight - texBlood.Height));

            //gun
            m_Gun = new Gun(Content, m_windowwidth, m_windowheight);
            m_Gun.LoadContent(texGun,
                              new Vector2(m_windowwidth.Val * 2));

            //button
            m_Button = new Button(Content, m_windowwidth);
            m_Button.LoadContent(m_Button.texButton,
                                 new Vector2(m_windowwidth.Val / 2 - m_Button.texButton.Width / 2, 0));

            //bullet
            m_Bullet = new Bullet(Content, m_windowwidth, m_windowheight);
            m_Bullet.LoadContent(texBullet, new Vector2(m_windowwidth.Val - 100));

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(0, m_windowheight - m_Newspaper.texNewspaper.Height));

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(1);
        }
コード例 #14
0
        public MV_Speech(ContentManager Content, WindowWidth windowwidth, int windowheight)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //loads sound effect
            Sound_MouseClick = Content.Load <SoundEffect>("Sound Files/Click").CreateInstance();

            //take the generic file name and add a number to it to find a specific one in the list
            for (int i = 0; i < texMVTextBox.Count(); i++)
            {
                texMVTextBox[i] = Content.Load <Texture2D>("Speeches/Textbox" + (i + 1));
            }
        }
コード例 #15
0
        public MenuRoom(ContentManager Content, WindowWidth windowwidth,
                        int windowheight, GraphicsDeviceManager graphics)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;
            m_graphics     = graphics;

            //loads sound effect
            Sound_MouseClick = Content.Load <SoundEffect>("Sound Files/Click");

            //textures
            var texStartNewGame = Content.Load <Texture2D>("Textures/Start");
            var texControls     = Content.Load <Texture2D>("Textures/Controls");
            var texExitGame     = Content.Load <Texture2D>("Textures/Exit");
            var SkullAnimation  = Content.Load <Texture2D>("Textures/Skull");

            texTitle = Content.Load <Texture2D>("Textures/Title");

            //animated skull
            anim_Skull          = new AnimatedSkull(SkullAnimation);
            anim_Skull.Position = new Vector2(0, m_windowheight - SkullAnimation.Height);

            //Start a new game
            m_StartNewGame = new ButtonStartNewGame();
            m_StartNewGame.LoadContent(texStartNewGame,
                                       new Vector2(m_windowwidth.Val / 2 - texStartNewGame.Width / 2,
                                                   m_windowheight - texExitGame.Height * 3 - 100));

            //Load the options
            m_Controls = new ButtonControls();
            m_Controls.LoadContent(texControls,
                                   new Vector2(m_windowwidth.Val / 2 - texStartNewGame.Width / 2,
                                               m_windowheight - texExitGame.Height * 2 - 50));

            //Exits the game
            m_Exit = new ButtonExit();
            m_Exit.LoadContent(texExitGame,
                               new Vector2(m_windowwidth.Val / 2 - texExitGame.Width / 2,
                                           m_windowheight - texExitGame.Height));
        }
コード例 #16
0
        public Opening_Scene(ContentManager content, WindowWidth windowwidth, int windowheight, Player player, GraphicsDeviceManager graphics)
        {
            //Asigns the variables
            m_content      = content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;
            m_graphics     = graphics;

            //sets the spawn location
            player.position = player.GenericSPWN;

            //Loads the font from the font sheet
            Font = content.Load <SpriteFont>("Font");

            //Textures
            var texSpeechBox = content.Load <Texture2D>("Textures/TextBox");
            var texTextBox   = content.Load <Texture2D>("Textures/GENERICTextBox");
            var texBackSpace = content.Load <Texture2D>("Textures/BackSpace");

            //animations
            var BloodAnimation = content.Load <Texture2D>("Textures/Blood");

            //animated blood
            anim_Blood          = new AnimatedBlood(BloodAnimation);
            anim_Blood.Position = new Vector2(m_windowwidth.Val - BloodAnimation.Width / 6, 0);

            //speech box
            m_SpeechBox = new SpeechBox();
            m_SpeechBox.LoadContent(texSpeechBox,
                                    new Vector2(m_windowwidth.Val / 2 - texSpeechBox.Width / 2, m_windowheight / 2 - texSpeechBox.Height / 2));

            //speech box
            m_TextBox = new Textbox();
            m_TextBox.LoadContent(texTextBox,
                                  new Vector2(m_windowwidth.Val / 2 - texTextBox.Width / 2, m_windowheight / 2 - texTextBox.Height / 2));

            m_BackSpace = new BackSpace();
            m_BackSpace.LoadContent(texBackSpace,
                                    new Vector2(0, m_windowheight - texBackSpace.Height));
        }
コード例 #17
0
        //constructor FOR ROOM2
        public Testing_room7(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //sets the spawn location
            player.position = player.GenericSPWN;

            //load explosions sprites for efficiency
            m_sprite = Content.Load <Texture2D>("Textures/Explosion");

            //create initial game objects
            for (int i = 0; i < InitialNum; ++i)
            {
                m_Explosions.Add(GetRandomExplosion());
            }

            //button
            m_Button = new Button(Content, m_windowwidth);
            m_Button.LoadContent(m_Button.texButton,
                                 new Vector2(m_windowwidth.Val / 2 - m_Button.texButton.Width / 2, 0));

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(0, m_windowheight - m_Newspaper.texNewspaper.Height));

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(6);
        }
コード例 #18
0
        //constructor FOR ROOM6
        public Testing_room6(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //sets the spawn location
            player.position = player.GenericSPWN;

            //Loads the sound file for from the content pipeline
            Wrong = Content.Load <SoundEffect>("Sound Files/Wrong");
            Right = Content.Load <SoundEffect>("Sound Files/Correct");

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //textures
            m_textBoxes = new List <Textbox>();
            var texTextBox = Content.Load <Texture2D>("TextBox");

            //textbox left
            var textbox = new Textbox();

            textbox.OnCollision += WrongAnswerCollision;
            textbox.LoadContent(texTextBox,
                                new Vector2(0, m_windowheight / 2 - texTextBox.Height / 2));
            m_textBoxes.Add(textbox);

            //textbox middle
            textbox              = new Textbox();
            textbox.OnCollision += CorrectAnswerCollision;
            textbox.LoadContent(texTextBox,
                                new Vector2(m_windowwidth.Val / 2 - texTextBox.Width / 2, m_windowheight / 2 - texTextBox.Height / 2));
            m_textBoxes.Add(textbox);

            //textbox right
            textbox              = new Textbox();
            textbox.OnCollision += WrongAnswerCollision;
            textbox.LoadContent(texTextBox,
                                new Vector2(m_windowwidth.Val - texTextBox.Width, m_windowheight / 2 - texTextBox.Height / 2));
            m_textBoxes.Add(textbox);

            //textbox question left
            textbox = new Textbox();
            textbox.LoadContent(texTextBox,
                                new Vector2(m_windowwidth.Val / 2 - texTextBox.Width / 6, m_windowheight / 2 - texTextBox.Height * 2.5f));
            m_textBoxes.Add(textbox);

            //textbox question right
            textbox = new Textbox();
            textbox.LoadContent(texTextBox,
                                new Vector2(m_windowwidth.Val / 2 - texTextBox.Width, m_windowheight / 2 - texTextBox.Height * 2.5f));
            m_textBoxes.Add(textbox);

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(0, m_windowheight - m_Newspaper.texNewspaper.Height));

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(5);
        }
コード例 #19
0
 //texture
 public Arrow(WindowWidth width)
 {
     m_ScreenWidth = width;
 }
コード例 #20
0
        //constructor FOR ROOM4
        public Testing_room4(ContentManager Content, WindowWidth windowwidth, int windowheight, Player player)
        {
            //Asigns the variables
            m_content      = Content;
            m_windowwidth  = windowwidth;
            m_windowheight = windowheight;

            //Where the player spawns when they die
            spawnLocation = new Vector2(m_windowwidth.Val - player.Texture.Width * 3, m_windowheight - player.Texture.Height);

            //sets the players position to the rooms spawn loaction
            player.position = spawnLocation;

            //Loads the font from the font sheet
            Arial = Content.Load <SpriteFont>("Font");

            //textures
            var texSpike = Content.Load <Texture2D>("Spike");

            //button
            m_Button = new Button(Content, m_windowwidth);
            m_Button.LoadContent(m_Button.texButton,
                                 new Vector2(m_Button.texButton.Width, 0));

            //bones
            m_Bones = new Bones(Content, m_windowwidth, m_windowheight);
            m_Bones.LoadContent(m_Bones.Texture,
                                new Vector2(m_Bones.tex.Width / 2, m_windowheight - m_Bones.tex.Height));

            //Newspaper
            m_Newspaper = new Newspaper(Content);
            m_Newspaper.LoadContent(m_Newspaper.texNewspaper,
                                    new Vector2(m_windowwidth.Val - m_Newspaper.texNewspaper.Width, 0));

            //list of spikes
            m_Spikes = new List <Spike>();

            //every X & Y value for the spikes
            int[] positions = new int[]
            {
                1, 1, 3, 1, 1, 2, 3, 2, 1, 3,
                1, 4, 2, 4, 3, 4, 4, 4, 5, 4,
                5, 3, 5, 2, 6, 2, 7, 2, 9, 2,
                9, 1, 9, 3, 9, 4, 8, 4, 7, 4,
                7, 6, 6, 6, 5, 6, 4, 6, 3, 6,
                2, 7, 2, 6, 2, 8, 8, 6, 9, 6,
                9, 7, 10, 7, 10, 8, 10, 4, 11, 4,
                11, 5, 12, 5
            };

            //position of new spike = original spike * next number in the array
            for (int s = 0; s < positions.Count(); s += 2)
            {
                var Spikes = new Spike();
                Spikes.LoadContent(texSpike,
                                   new Vector2(m_windowwidth.Val - texSpike.Width * positions[s], m_windowheight - texSpike.Height * positions[s + 1]));
                m_Spikes.Add(Spikes);
            }

            //Loads the speech class
            m_Speech = new MV_Speech(Content, m_windowwidth, m_windowheight);

            //Chooses which speech to start each level with
            m_Speech.StartTalking(3);
        }