home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / LipSync / move.dba < prev    next >
Encoding:
Text File  |  2001-01-23  |  1.3 KB  |  53 lines

  1. `move.dba, a little utility for positioning .X objects...
  2. `use keys in the middle of the keyboard to move it:
  3. `T-Y moves object in and out
  4. `G-H moves object down and up
  5. `B-N moves object left and right
  6. `arrow keys rotate object x and y
  7. `Esc to exit.
  8. `The two numbers displayed are the x,y,(no z) for Rotate Object
  9. `The three numbers displayed are the x,y,z for Position Object
  10.  
  11. sync on
  12. rem Load your object...
  13. load object "bmp\mouth.x",1
  14.  
  15. xover#=0: ydown#=0 : zin#=0
  16. position object 1,xover#,ydown#,zin#
  17. x=2 : y=9
  18. rotate object 1,x,y,0
  19. set ambient light 100
  20. hide mouse
  21.  
  22. do
  23.    if leftkey() then inc y : rotate object 1,x,y,0
  24.    if rightkey() then dec y : rotate object 1,x,y,0
  25.    if upkey() then inc x : rotate object 1,x,y,0
  26.    if downkey() then dec x : rotate object 1,x,y,0
  27.  
  28.    if y>359 then y=1
  29.    if y<1 then y=359
  30.    if x>359 then x=1
  31.    if x<1 then x=359
  32.  
  33.    if keystate(48)=1 then xover#=xover#-.1
  34.    if keystate(49)=1 then xover#=xover#+.1
  35.    if keystate(34)=1 then ydown#=ydown#-.1
  36.    if keystate(35)=1 then ydown#=ydown#+.1
  37.    if keystate(20)=1 then zin#=zin#-.1
  38.    if keystate(21)=1 then zin#=zin#+.1
  39.  
  40.    position object 1,xover#,ydown#,zin#
  41.  
  42. text 0,0,str$(x)+", "+str$(y)
  43. text 0,20,str$(xover#)+", "+str$(ydown#)+", "+str$(zin#)
  44.  
  45. sync
  46. while mouseclick()=1
  47. wait 1
  48. endwhile
  49. loop
  50.  
  51. delete object 1
  52. end
  53.