home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / basic3d / exam10.dba < prev    next >
Encoding:
Text File  |  1999-12-08  |  1.2 KB  |  59 lines

  1. Rem * Title  : Picking An Item
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ============================================
  5. rem DARK BASIC EXAMPLE PROGRAM 10
  6. rem ============================================
  7. rem This program demonstrates picking up an item
  8. rem --------------------------------------------
  9.  
  10. rem Load your object
  11. load object "walk.x",1
  12. yrotate object 1,180
  13. fix object pivot 1
  14. loop object 1,5,25
  15. position object 1,0,0,500
  16. yrotate object 1,180
  17.  
  18. rem Make a cone in the distance
  19. make object cone 2,25.0
  20. position object 2,10,0,250
  21. scale object 2,100,10,100
  22.  
  23. rem Point character towards cone
  24. point object 1,object position x(2),0,object position y(2)
  25.  
  26. rem Activate manual sync
  27. sync on
  28.  
  29. rem Camera position
  30. position camera 0,100,0
  31.  
  32. rem Begin main loop
  33. while mouseclick()=0
  34.  
  35. rem Move character
  36. move object 1,1
  37.  
  38. rem If chartacter collides with cone
  39. if object collision(1,2)=1
  40.     rem pick up sphere and make sure cannot detect it any more
  41.     glue object to limb 2,1,4
  42.     position object 2,0,0,0
  43.     set object collision off 2
  44. endif
  45.  
  46. rem When spacebar is hit, drop the cone
  47. if spacekey()=1
  48.     unglue object 2
  49. endif
  50.  
  51. rem Update Screen
  52. sync
  53.  
  54. rem End main loop
  55. endwhile
  56.  
  57. rem End the program
  58. end
  59.