コード例 #1
0
ファイル: Player.cs プロジェクト: silenthunter/MPG4803
 public Player(Game game)
     : base(game)
 {
     gameP = game;
     audioComponent = new AudioComponent(game);
     game.Components.Add(audioComponent);
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: gitaishhub/cs4803mpg
 public Player(Game game)
     : base(game)
 {
     gameP = game;
     this.rng = new Random();
     audioComponent = new AudioComponent(game);
     game.Components.Add(audioComponent);
 }
コード例 #3
0
ファイル: Game1.cs プロジェクト: gitaishhub/cs4803mpg
        protected override void Initialize() {

            // Audio
            audioComponent = new AudioComponent(this);
            Components.Add(audioComponent);

            // initialize the player
            // a better programming style would put player into one class
            InitPlayer();
            InitEnemy();

            spin = new Vector3(0.0f, 0.0f, 0.0f);

            viewMatrix = Matrix.CreateLookAt(Arnold.Position, (Arnold.Position + Arnold.LookAtVec), Vector3.Up);
            projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
                    MathHelper.ToRadians(45),
                    (float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Viewport.Height,
                    1f, 1024f);

            //Setup the view matrix for shadow mapping.
            this.lightProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver2, 1, 0.1f, 1024f);

            Arnold.ViewMatrix = viewMatrix;
            Arnold.ProjectionMatrix = projectionMatrix;

            //This should be done in LoadContent(), but the enemy needs it now-ish so I'm just moving it here.
            this.P4Effect = Content.Load<Effect>("Project4/P4Shader");
            this.enemy.ViewMatrix = viewMatrix;
            this.enemy.ProjectionMatrix = projectionMatrix;

            // initialize the room
            SetupRoom();

            // Add lights
            InstallLights();

            // Add furniture
            InstallFurniture();

            base.Initialize();

            backmusic = audioComponent.GetCue("footsteps1");
            backmusic.Play();

        }
コード例 #4
0
ファイル: Game1.cs プロジェクト: aliuy/MPG
        protected override void Initialize()
        {
            // Audio
            audioComponent = new AudioComponent(this);
            Components.Add(audioComponent);

            // initialize the player
            // a better programming style would put player into one class
            InitPlayer();

            InitEnemy();

            spin = new Vector3(0.0f, 0.0f, 0.0f);

            // initialize the room
            SetupRoom();

            // Add lights
            InstallLights();

            // Add furniture
            InstallFurniture();

            base.Initialize();

            backmusic = audioComponent.GetCue("footsteps1");
            backmusic.Play();
        }
コード例 #5
0
ファイル: Game1.cs プロジェクト: silenthunter/MPG4803
        protected override void Initialize()
        {
            // Audio
            audioComponent = new AudioComponent(this);
            Components.Add(audioComponent);

            // initialize the player
            // a better programming style would put player into one class
            InitPlayer();

            spin = new Vector3(0.0f, 0.0f, 0.0f);

            viewMatrix = Matrix.CreateLookAt(Arnold.Position, (Arnold.Position + Arnold.LookAtVec), Vector3.Up);
            projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
                    MathHelper.ToRadians(45),
                    (float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Viewport.Height,
                    0.1f, 5000.0f);

            Arnold.ViewMatrix = viewMatrix;
            Arnold.ProjectionMatrix = projectionMatrix;

            // initialize the room
            SetupRoom();

            // Add lights
            InstallLights();

            // Add furniture
            InstallFurniture();

            // Add Enemy
            //InstallEnemy();

            base.Initialize();

            backmusic = audioComponent.GetCue("footsteps1");
            backmusic.Play();
        }