home *** CD-ROM | disk | FTP | other *** search
/ DarkBasic Professional / DarkBasicPro.iso / data1.cab / Lang_Files_(English) / Projects / 3DVideo / 3DVideo.dba next >
Encoding:
Text File  |  2004-09-22  |  3.4 KB  |  146 lines

  1. Rem Project: 3DVideo
  2. Rem Created: 10/08/2002 07:03:30
  3. rem Hours: 4
  4.  
  5. rem Init
  6. sync on : sync rate 0 : hide mouse
  7.  
  8. rem Switch display mode if available
  9. if check display mode(1024,768,32)=1 then set display mode 1024,768,32
  10.  
  11. rem Set default screen
  12. color backdrop rgb(0,32,32)
  13. set text font "Verdana"
  14. ink rgb(0,255,0),0
  15. set text to bold
  16. set text size 20
  17.  
  18. rem Load animation
  19. load animation "7clicks.wmv",1
  20.  
  21. rem Direct animation to texture
  22. play animation to image 1,1,0,0,320,240
  23. stop animation 1
  24.  
  25. rem Create 3D projection
  26. for p=1 to 3
  27.  make object box p,320,240,10
  28.  scale object p,p*250,p*250,p*250
  29.  if p>1 then ghost object on p,2
  30.  texture object p,1
  31. next p
  32. set object light 1,0
  33.  
  34. rem Setup camera
  35. position camera 0,0,-700
  36. rotate camera 0,0,0
  37.  
  38. rem Load sound
  39. load sound "type.wav",1 : set sound volume 1,80 : set sound speed 1,44000
  40. load sound "type.wav",2 : set sound volume 2,80 : set sound speed 2,44000
  41.  
  42. rem Text data
  43. dim htext$(5)
  44.  
  45. rem Main loop
  46. begin=1
  47. while mouseclick()=0
  48.  
  49.  rem Begin animation and narration
  50.  if begin=1
  51.   begin=0
  52.   restore
  53.   stop animation 1
  54.   loop animation 1
  55.   narstage=0 : pause=0 : text$=""
  56.   for h=1 to 5 : htext$(h)="" : next h
  57.   time=timer()
  58.  endif
  59.  
  60.  rem Move projection around
  61.  for p=1 to 3
  62.   a#=wrapvalue(a#+1.0)
  63.   position object p,cos(a#)*20,sin(a#)*10,p*75
  64.   yrotate object p,cos(a#)*20
  65.   zrotate object p,(p-1)*10
  66.  next p
  67.  
  68.  rem Teletype
  69.  seconds=timer()-time
  70.  inc pause
  71.  if pause>=0
  72.   pause=0
  73.   if narstage=0
  74.    read triggersec
  75.    read leaper
  76.    narstage=1
  77.   endif
  78.   if narstage=1
  79.    if seconds>=triggersec then narstage=2
  80.   endif
  81.   if narstage=2
  82.    read nar$
  83.    if nar$="*" then end
  84.    narstage=3
  85.    nari=1
  86.   endif
  87.   if narstage=3
  88.    for r=1 to leaper
  89.     if nari<=len(nar$)
  90.      a$=mid$(nar$,nari)
  91.      text$=text$+upper$(a$)
  92.      if sound playing(1)=0 then play sound 1
  93.      if sound playing(2)=0 then play sound 2
  94.      inc nari
  95.     endif
  96.    next r
  97.    if nari>len(nar$)
  98.     for h=5 to 2 step -1
  99.      htext$(h)=htext$(h-1)
  100.     next h
  101.     htext$(1)=text$
  102.     narstage=0
  103.     text$=""
  104.    endif
  105.   endif
  106.  endif
  107.  basey=screen height()-40
  108.  for h=1 to 5
  109.   text 32,basey-(h*16),htext$(h)
  110.  next h
  111.  text 32,basey,text$
  112.  
  113.  rem Update screen
  114.  sync
  115.  
  116. rem End loop
  117. endwhile
  118.  
  119. rem Narration:
  120. data 1500,1,"Let me show you how to create your very own"
  121. data 1500,1,"computer program in seven clicks."
  122. data 8500,2,"This is nothing original as we have done this"
  123. data 8500,1,"type of software before."
  124. data 12250,1,"What is original is that I can do this in seven"
  125. data 12250,1,"clicks and it's a programming language!"
  126. data 18750,2,"And by the way clicks to do include keyboard"
  127. data 20000,1,"presses - subclause 1(one)."
  128. data 25000,2,"First thing we do is load the software."
  129. data 30500,2,"That was two clicks."
  130. data 32750,1,"The third click is here and the forth click"
  131. data 32750,2,"is here."
  132. data 38000,1,"Now we type out a name."
  133. data 43000,1,"The fifth click is here."
  134. data 47500,1,"The sixth click is there, where we type out"
  135. data 47500,1,"a very simple program."
  136. data 55000,1,"And the seventh and final click is the click"
  137. data 55000,1,"to compile and run the program."
  138. data 61000,1,"Click!"
  139. data 64000,1,"And there you go."
  140. data 65000,2,"Hello world, two lines of code."
  141. data 67500,1,"Very simple."
  142. data 68500,1,"And all done in just seven clicks!"
  143. data 71500,1,""
  144. data 71500,1,"*"
  145.  
  146.