duck

duck

Jul 2nd, 2010
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. var wasSnapped : boolean;
  6.  
  7. function Update() {
  8.  
  9. snap = false;
  10.  
  11. for (snapPos in snapPositions) {
  12. (if touch is near snapPos) {
  13. snap = true;
  14. }
  15. }
  16.  
  17. if (snap) {
  18.  
  19. if (!wasSnapped) {
  20.  
  21. // this is the first frame of a snap!
  22. send snap position
  23.  
  24. }
  25.  
  26. } else {
  27.  
  28. send touch position
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment