I have been fiddling with MathHelp.Lerp(); trying to find the easiest way to rotate the direction the missile is traveling. Right now it will instantly go the direction the player/mouse is located.
Would Larp be the best to use or would some other type of direction rotation be what I should be after? Latest post, example of what I mean.
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
delta = (float)gameTime.ElapsedGameTime.TotalSeconds * Speed;
direction = mousePosition - missilePosition;
direction.Normalize();
missilePosition += direction * delta;
//missilePosition = Vector2.Lerp(missilePosition, mousePosition, 2.0f);
mouse = Mouse.GetState();
mousePosition = new Vector2(mouse.X, mouse.Y);
base.Update(gameTime);
}
Having the image rotate with the direction of the missile is also something that I have been looking up and trying to figure out. How would I have the image rotate as the direction rotates?