コード例 #1
0
ファイル: Physics.cs プロジェクト: Gkeane12/Gp3
 /// <summary>
 /// Add balloons to the collidable list
 /// </summary>
 /// <param name="balloon"></param>
 /// <param name="No"></param>
 public void addBalloons(Luft balloon, int No)
 {
     balloons[No] = new BoundingSphere(balloon.Position, balloon.charModel.Meshes[0].BoundingSphere.Radius * 1.0f);
 }
コード例 #2
0
ファイル: Game1.cs プロジェクト: Gkeane12/Gp3
        /// <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);
            screencentre = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2);

            Pop = Content.Load<SoundEffect>(".\\Sound\\BruitSec");
            Enemy = new Jets();
            for (int i = 0; i < Enemy.jets.Length; i++)
            {
                Enemy.jets[i].charModel = Content.Load<Model>(".\\Models\\balloonRed");
            }
            Jet = Content.Load<Model>(".\\Models\\eurofighter fbx");

            player = new mainPlayer(cameraPosition, screencentre, aspectRatio);
            player.charModel = Content.Load<Model>(".\\Models\\RedBalloon");

            newcamera = new Camera(campos2, Vector3.Zero, Vector3.Up, screencentre);
            newcamera.setPerspectiveProjection(45.0f, aspectRatio, 1.0f, 1000.0f);
            thirdPerCamera = new Camera(player.Position + thirdPerOffset, player.Position,Vector3.Up,screencentre);
            thirdPerCamera.setPerspectiveProjection(45.0f, aspectRatio , 1.0f, 1000.0f);

            physics = new Physics(player.bulletlist.Length, redballoon.Length);

            Font = Content.Load<SpriteFont>(".\\Fonts\\Basic");

            Button = Content.Load<Texture2D>(".\\Textures\\Button");
            StartButton = new GuiElements((screencentre - new Vector2(Button.Width - 100 ,Button.Height + 120)));
            Medium = new GuiElements((screencentre - new Vector2(Button.Width - 100, Button.Height - 120)));
            Hard = new GuiElements((screencentre - new Vector2(Button.Width - 100, Button.Height)));

            //Textures For Weapon Equip Gui
            WeaponGUI[0] = Content.Load<Texture2D>(".\\Textures\\KnifeSelected");
            WeaponGUI[1] = Content.Load<Texture2D>(".\\Textures\\KnifeUnSelected");
            WeaponGUI[2] = Content.Load<Texture2D>(".\\Textures\\GunSlelected");
            WeaponGUI[3] = Content.Load<Texture2D>(".\\Textures\\GunUnslelected");
            WeaponGUI[4] = Content.Load<Texture2D>(".\\Textures\\goldenBulletsel");
            WeaponGUI[5] = Content.Load<Texture2D>(".\\Textures\\goldenBulletUnsel");

            WeaponsState[0] = new GuiElements(new Vector2(screencentre.X - (2.0f * (WeaponGUI[0].Width) / 2), 350.0f));
            WeaponsState[1] = new GuiElements(new Vector2(screencentre.X -  (0.5f * (WeaponGUI[0].Width) / 2), 350.0f));
            WeaponsState[2] = new GuiElements ( new Vector2(screencentre.X +  (2.0f * (WeaponGUI[0].Width) / 2),350.0f));

            crosshair = Content.Load<Texture2D>(".\\Textures\\crosshair");
            crosshairpos = new Vector2((screencentre.X - (crosshair.Width / 2)), (screencentre.Y - (crosshair.Height / 2)));

            XboxController = Content.Load<Texture2D>(".\\Textures\\Contorller");
            controllerSelectScreem = Content.Load<Texture2D>(".\\Textures\\ControllerSelection");
            KeyBoardController = Content.Load<Texture2D>(".\\Textures\\keyboard");

            player.available = mainPlayer.Weapons.shortRange;

            currentcamera = player.eyes;

            icounter = 99;

            for (int i = 0; i < player.bulletlist.Length; i++)
            {
                player.bulletlist[i].charModel = Content.Load<Model>(".\\Models\\Bullet");
                player.bulletlist[i].charRotation += MathHelper.Pi;

            }

            player.shortRange.charModel = Content.Load<Model>(".\\Models\\Short");
            player.LongRange.charModel = Content.Load<Model>(".\\Models\\Untitled");

            for (int i = 0; i < redballoon.Length; i++)
            {

                balloonPos = new Vector3(random.Next(playfield), 0.0f, random.Next(playfield));
                redballoon[i] = new Luft(balloonPos);
                redballoon[i].charModel = Content.Load<Model>(".\\Models\\RedBalloon");

            }
            GreenBalloon = new Character( new Vector3(80.0f,40.0f,120.0f));
            GreenBalloon.charModel = Content.Load<Model>(".\\Models\\balloonGreen");
            BlueBalloon = new Character( new Vector3(120.0f,0.0f,80.0f));
            BlueBalloon.charModel = Content.Load<Model>(".\\Models\\balloonBlue");
            GoldBalloon = new Character(new Vector3( 0.0f, 110.0f, 0.0f));
            GoldBalloon.charModel = Content.Load<Model>(".\\Models\\balloonGold");

            //-------------------------------------------------------------
            // added to load Model
            //-------------------------------------------------------------

            aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio;

            // TODO: use this.Content to load your game content here
        }