home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / tutorial / programs / sample08.dba < prev    next >
Encoding:
Text File  |  2000-04-10  |  718 b   |  43 lines

  1. Rem * Title  : Tutorial Sample 8
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1/8/99
  4. rem Load character into hidden bitmap
  5. LOAD BITMAP "runner.bmp",1
  6.  
  7. rem Grab images for character animation
  8. FOR y=0 to 1
  9. FOR x=0 TO 6
  10. GET IMAGE 1+x+(y*7),(x*89),(y*120),(x*89)+89,(y*120)+120
  11. NEXT x
  12. NEXT y
  13.  
  14. rem Delete character bitmap
  15. DELETE BITMAP 1
  16.  
  17. rem Set player variables
  18. xpos=0
  19. ypos=300
  20. image=1
  21.  
  22. rem Activate manual syncronization
  23. SYNC ON
  24.  
  25. rem Begin Loop
  26. DO
  27.  
  28. rem Run right and wrap
  29. xpos=xpos+6 : IF xpos>640 THEN xpos=-64
  30.  
  31. Rem Animate runner and wrap
  32. image=image+1 : IF image>12 THEN image=2
  33.  
  34. rem Update sprite
  35. sprite 1,xpos,ypos,image
  36.  
  37. rem Refresh screen now
  38. SYNC : SLEEP 20
  39.  
  40. rem End Loop
  41. LOOP
  42.  
  43.