public void KeyDown(PlayerState player, GameTime gameTime) { newState = Mouse.GetState(); if (Keyboard.GetState().IsKeyDown(Keys.W)) { Direction[0] = true; } if (Keyboard.GetState().IsKeyDown(Keys.A)) { Direction[1] = true; } if (Keyboard.GetState().IsKeyDown(Keys.D)) { Direction[2] = true; } if (Keyboard.GetState().IsKeyDown(Keys.Space)) { //TODO //ADD PROJECTILE FIRING HERE linearMover.Move(player.FireProjectile(), gameTime); } Console.WriteLine(Direction[0] + " | " + Direction[1] + " | " + Direction[2] + " | " + newState.X + " | " + newState.Y); Movement(player, gameTime); }
public override void Update(GameTime gameTime) { health -= (gameTime.ElapsedGameTime.Milliseconds / 100.0f); if (health >= 0) { movement.Move(this, gameTime); position.X += velocity.X; position.Y += velocity.Y; } }
public override void Update(GameTime gameTime) { movement.Move(this, gameTime); Origin.X = image.Width / (2); Origin.Y = image.Height / (2); rotation += rotationSpeed; position.X += velocity.X; position.Y += velocity.Y; }