home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH5 / SRC / RSTUFF.BAS < prev    next >
Encoding:
BASIC Source File  |  1996-02-27  |  1.4 KB  |  53 lines

  1. Attribute VB_Name = "RobotStuff"
  2. Option Explicit
  3.  
  4. ' Distances for measuring closeness.
  5. Global Const NEAR = 2
  6. Global Const NEAR2 = 2 * NEAR
  7.  
  8. ' Robot dimensions.
  9. Global Const UARM_LEN = 40
  10. Global Const LARM_LEN = 40
  11. Global Const ULEG_LEN = 40
  12. Global Const LLEG_LEN = 40
  13. Global Const NECK_LEN = 10
  14. Global Const TRUNK_LEN = UARM_LEN * 1.1
  15. Global Const BODY_LEN = NECK_LEN + TRUNK_LEN
  16. Global Const HEAD_RAD = (UARM_LEN - NECK_LEN) / 2
  17.  
  18. ' Robot parts.
  19. Global Const MIN_PART = 0
  20. Global Const PART_HEAD = 0
  21. Global Const PART_LELBOW = 1
  22. Global Const PART_RELBOW = 2
  23. Global Const PART_LHAND = 3
  24. Global Const PART_RHAND = 4
  25. Global Const PART_LKNEE = 5
  26. Global Const PART_RKNEE = 6
  27. Global Const PART_LFOOT = 7
  28. Global Const PART_RFOOT = 8
  29. Global Const MAX_CONTROL_PART = 8
  30. Global Const PART_HIPS = 9
  31. Global Const PART_NECK = 10
  32. Global Const PART_SHOULDERS = 11
  33. Global Const MAX_PART = 11
  34.  
  35. #If Win32 Then
  36.     Declare Function GetTickCount Lib "kernel32" () As Long
  37. #Else
  38.     Declare Function GetTickCount Lib "User" () As Long
  39. #End If
  40.  
  41. ' ************************************************
  42. ' Pause until GetTickCount shows the indicated
  43. ' time. This is accurate to within one clock tick
  44. ' (55 ms), not counting variability in DoEvents
  45. ' and Windows itself.
  46. ' ************************************************
  47. Sub WaitTill(next_time As Long)
  48.     Do
  49.         DoEvents
  50.     Loop While GetTickCount() < next_time
  51. End Sub
  52.  
  53.