public Player(Game game) : base(game) { gameP = game; audioComponent = new AudioComponent(game); game.Components.Add(audioComponent); }
public Player(Game game) : base(game) { gameP = game; this.rng = new Random(); audioComponent = new AudioComponent(game); game.Components.Add(audioComponent); }
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(); }
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(); }
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(); }