Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. protected override void Update(GameTime gameTime)
  2. {
  3. mouse = Mouse.GetState();
  4. mousePosition = new Vector2(mouse.X, mouse.Y);
  5.  
  6. delta = (float)gameTime.ElapsedGameTime.TotalSeconds * Speed;
  7.  
  8. direction = mousePosition - missilePosition;
  9. direction.Normalize();
  10. missilePosition += direction * delta;
  11.  
  12. d.X = mouse.X - missilePosition.X;
  13. d.Y = mouse.Y - missilePosition.Y;
  14.  
  15. distance = Math.Sqrt((d.X * d.X) + (d.Y * d.Y));
  16.  
  17. v.X += d.X * turning;
  18. v.X += d.X * turning;
  19.  
  20. Velocity = Math.Sqrt((v.X * v.X) + (v.Y * v.Y));
  21.  
  22. Vector2 direction = Vector2.Lerp(mousePosition, missilePosition, 0.5f);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement