Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. '--- sprite demo - Paulo Silva (GPL) - 040503 - 100917
  3. '--- a small example for sprite performance testing
  4. '--- (sdlBasic version from an example i posted in the wxBasic forum)
  5.  
  6. tmpfpref$="_tmpr_"
  7. fout$="_final_2880p_"
  8. randomize
  9.  
  10. xed=5120:yed=2880:sprn=32:maxspd=4:spram=12:secs=30
  11.  
  12. dim xdr[sprn],ydr[sprn],xpo[sprn],ypo[sprn],sprid[sprn]
  13. for i=0 to sprn:sprid[i]=3:next
  14.  
  15. wdwd=1
  16. setdisplay(xed,yed,32,wdwd)
  17.  
  18. for i=0 to sprn:xdr[i]=rnd(4):ydr[i]=rnd(4):xpo[i]=rnd(xed):ypo[i]=rnd(yed):next
  19. screenopen (1,xed,yed,0,0,0,0,0)
  20. shell("convert 04.svg _tm.png")
  21. loadimage("_tm.png",1):pasteicon(0,0,1):screen(1)
  22. shell("rm _tm.png")
  23.  
  24. for y=0 to 1:For x=0 To 9:k=x+(y*10):grab(1+k,x*32,y*32,32,32):next:next
  25. screen(0)
  26.  
  27. frm=0
  28. while frm<(25*secs)
  29.   setcaption(str$(frm)+"/"+str$(25*secs))
  30.   for xt=0 to xed step 32:for yt=0 to yed step 32
  31.     pasteicon(xt,yt,1):next:next
  32.   for i=0 to sprn-1
  33.     bob(1+i,xpo[i],ypo[i],sprid[i])
  34.     pastebob(xpo[i],ypo[i],sprid[i])
  35.     xpo[i]=xpo[i]+xdr[i]:ypo[i]=ypo[i]+ydr[i]
  36.     if xpo[i]>(xed-32) then:xpo[i]=0:end if
  37.     if xpo[i]<0 then:xpo[i]=(xed-32):end if
  38.     if ypo[i]>(yed-32) then:ypo[i]=0:end if
  39.     if ypo[i]<0 then:ypo[i]=(yed-32):end if      
  40.     next
  41.   i=rnd(sprn):xdr[i]=(rnd(8)-4):ydr[i]=(rnd(8)-4):sprid[i]=1+(rnd(spram))
  42.   if key(27) then:end:end if
  43.   grab(spram+10,0,0,xed,yed):saveimage("frames/"+tmpfpref$+str$(frm)+".bmp",spram+10)
  44.   shell("convert frames/"+tmpfpref$+str$(frm)+".bmp frames/"+tmpfpref$+str$(frm)+".jpg")
  45.   shell("rm frames/"+tmpfpref$+str$(frm)+".bmp")
  46.   frm+=1
  47.   wend
  48.  
  49. shell ("ffmpeg -i frames/"+tmpfpref$+"%d.jpg -target pal-dvd -s "+str$(xed)+"x"+str$(yed)+" "+fout$+".mpg")
  50. '- ffmpeg -i frames/_tmpr_%d.jpg -target pal-dvd -s 5120x2880 _final_2880p_.mpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement