Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: C#  |  size: 0.40 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2.             TouchCollection touches = TouchPanel.GetState();
  3.  
  4.             for (int x = 0; x < touches.Count; x++)
  5.             {
  6.                 if (touches[x].State == TouchLocationState.Moved)
  7.                 {
  8.                     Vector2 diff = touches[x].Position - targetPos;
  9.                     if (diff.Length() < 30)
  10.                         targetPos.Y += 1;
  11.                 }
  12.             }