home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / basic3d / exam08.dba < prev    next >
Encoding:
Text File  |  1999-11-16  |  1.3 KB  |  61 lines

  1. Rem * Title  : Backdrop Control
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 8
  6. rem ==========================================
  7. rem This program controls the 3D backdrop
  8. rem ------------------------------------------
  9.  
  10. rem Create a simple image
  11. circle 64,64,54
  12. get image 1,0,0,128,128
  13. get image 2,64,64,128,128
  14.  
  15. rem Load and animate your object (backdrop is auto-activated)
  16. load object "walk.x",1
  17. loop object 1,5,25
  18.  
  19. rem Activate manual sync
  20. sync on
  21.  
  22. rem Begin main loop
  23. while mouseclick()=0
  24.  
  25. rem Inform user
  26. set cursor 0,0
  27. print "Press [1] or [2] to see backdrop effects!"
  28.  
  29. rem Use number keys to reveal backdrop effects
  30. if inkey$()="1" then color backdrop rgb(255,0,0)
  31. if inkey$()="2" then texture backdrop 1
  32. if inkey$()="3" then texture backdrop 2
  33.  
  34. rem Continually scroll backdrop to reveal itself when textured
  35. x=x+1
  36. y=y-1
  37. scroll backdrop x,y
  38.  
  39. rem Position the object to circle in and out of the fog
  40. a#=wrapvalue(a#+2.0)
  41. yrotate object 1,a#
  42. position object 1,sin(a#)*100.0,0.0,(cos(a#)*500.0)+500.0
  43.  
  44. rem Update Screen
  45. sync
  46.  
  47. rem End main loop
  48. endwhile
  49.  
  50. rem Switch off backdrop
  51. backdrop off
  52.  
  53. rem Wait 1 second to see the result
  54. sleep 1000
  55.  
  56. rem Now delete your object
  57. delete object 1
  58.  
  59. rem End the program
  60. end
  61.