예제 #1
0
 public Tunnel(ObserverGame game)
     : base(game)
 {
     var_Model = game.Content.Load<Model>("Model\\Tunnel");
     var_Position = new Vector3(0, 0, -8000);
     var_Bounding_Region = new BoundingSphere(var_Position, 1);
     var_Tunnel_Wall = new BoundingCircle(3500);
     var_DrawableObjects.Add(this);
     game.Components.Add(this);
 }
예제 #2
0
        public UI(ObserverGame game, SpriteBatch spriteBatchIn, int initialHealth, int initialBombs)
            : base(game)
        {
            var_SpriteBatch = spriteBatchIn;
            var_Current_Health = initialHealth;
            var_Current_Bombs = initialBombs;

            var_Game_Font = game.Content.Load<SpriteFont>("MotorwerkOblique");
            var_UI_Texture = game.Content.Load<Texture2D>("UiOverlay");

            game.Components.Add(this);
        }
        public GameCamera(ObserverGame game)
            : base(game)
        {
            var_Aspect_Ratio = game.GraphicsDevice.Viewport.AspectRatio;
            var_Near_Plane = 10.0f;
            var_Far_Plane = 8500.0f;
            var_Field_Of_View = 65.0f;
            var_Up = Vector3.Up;

            UpdateCamera();

            game.Components.Add(this);
        }
예제 #4
0
        public Bomb(ObserverGame game, Vector3 spawnPoint)
            : base(game)
        {
            var_Model = game.Content.Load<Model>("Model\\Bomb");

            var_Position = spawnPoint;

            var_Bounding_Region = new BoundingSphere(var_Position, 40);

            var_Explosion_Expansion_Countdown = 60;

            var_DrawableObjects.Add(this);
            game.Components.Add(this);
        }
예제 #5
0
        public Laser(ObserverGame game, Vector3 spawnPoint)
            : base(game)
        {
            var_Model = game.Content.Load<Model>("Model\\laser");

            var_Position = spawnPoint;

            var_Bounding_Region = new BoundingSphere(var_Position, 20);

            Visible = false;
            var_HasBeenInCamera = false;

            var_DrawableObjects.Add(this);
            game.Components.Add(this);
        }
예제 #6
0
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            var_Game = this;

            var_InputHandler = new InputHandler(this);
            var_SpriteBatch = new SpriteBatch(GraphicsDevice);

            var_GameCamera = new GameCamera(this);
            var_PlayerShip = new PlayerShip(this, Vector3.Zero, var_GameCamera);
            var_Director = new NewDirector(this, ChallengeLevel.Normal);
            var_SegmentGenerator = new SegmentGenerator(var_Game, ChallengeLevel.Normal, var_GameCamera, var_Director );
            var_Tunnel = new Tunnel(this);
            var_UI = new UI(this, var_SpriteBatch, var_PlayerShip.var_Health, var_PlayerShip.var_Bomb_Count);

            AssignSubscribers();

            base.Initialize();
        }
        public PlayerShip(ObserverGame game, Vector3 spawnPoint, GameCamera cameraIn)
            : base(game)
        {
            var_Model = game.Content.Load<Model>("Model\\StarFighter");

            sfxBoost = game.Content.Load<SoundEffect>("SFX\\boost");
            sfxBreak = game.Content.Load<SoundEffect>("SFX\\brake");
            sfxHitObstacle = game.Content.Load<SoundEffect>("SFX\\arwingHitObstacle");
            sfxSingleLaserShot = game.Content.Load<SoundEffect>("SFX\\arwingSingleLaserOneShot");
            sfxBombFired = game.Content.Load<SoundEffect>("SFX\\bombFireAndExplode");

            var_Position = spawnPoint;
            var_Previous_Position = var_Position;
            var_Velocity = 0;
            var_Axis_Of_Rotation = Vector3.Zero;
            var_Cooldown_Timer = 0;
            var_Bomb_Count = CONST_STARTING_BOMBS;
            var_Health = CONST_STARTING_HITPOINTS;
            var_Accellerate = false;

            var_Bounding_Circle = new BoundingCircle(3500);

            //var_Bounding_Region = new BoundingSphere(var_Position, 250);

            //var_Bounding_Region = new BoundingSphere(var_Position , 30);

            var_Bounding_Region = new BoundingSphere(new Vector3(var_Position.X, var_Position.Y, var_Position.Z - 560), 50);

            var_Ship_Bounding_Regions = new List<BoundingSphere>();
            //var_Ship_Bounding_Regions.Add(new BoundingSphere(var_Position, 30));

            camera = cameraIn;

            var_DrawableObjects.Add(this);

            game.Components.Add(this);
        }