Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '--- sprite demo - Paulo Silva (GPL) - 040503 - 100917
- '--- a small example for sprite performance testing
- '--- (sdlBasic version from an example i posted in the wxBasic forum)
- tmpfpref$="_tmpr_"
- fout$="_final_2880p_"
- randomize
- xed=5120:yed=2880:sprn=32:maxspd=4:spram=12:secs=30
- dim xdr[sprn],ydr[sprn],xpo[sprn],ypo[sprn],sprid[sprn]
- for i=0 to sprn:sprid[i]=3:next
- wdwd=1
- setdisplay(xed,yed,32,wdwd)
- for i=0 to sprn:xdr[i]=rnd(4):ydr[i]=rnd(4):xpo[i]=rnd(xed):ypo[i]=rnd(yed):next
- screenopen (1,xed,yed,0,0,0,0,0)
- shell("convert 04.svg _tm.png")
- loadimage("_tm.png",1):pasteicon(0,0,1):screen(1)
- shell("rm _tm.png")
- 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
- screen(0)
- frm=0
- while frm<(25*secs)
- setcaption(str$(frm)+"/"+str$(25*secs))
- for xt=0 to xed step 32:for yt=0 to yed step 32
- pasteicon(xt,yt,1):next:next
- for i=0 to sprn-1
- bob(1+i,xpo[i],ypo[i],sprid[i])
- pastebob(xpo[i],ypo[i],sprid[i])
- xpo[i]=xpo[i]+xdr[i]:ypo[i]=ypo[i]+ydr[i]
- if xpo[i]>(xed-32) then:xpo[i]=0:end if
- if xpo[i]<0 then:xpo[i]=(xed-32):end if
- if ypo[i]>(yed-32) then:ypo[i]=0:end if
- if ypo[i]<0 then:ypo[i]=(yed-32):end if
- next
- i=rnd(sprn):xdr[i]=(rnd(8)-4):ydr[i]=(rnd(8)-4):sprid[i]=1+(rnd(spram))
- if key(27) then:end:end if
- grab(spram+10,0,0,xed,yed):saveimage("frames/"+tmpfpref$+str$(frm)+".bmp",spram+10)
- shell("convert frames/"+tmpfpref$+str$(frm)+".bmp frames/"+tmpfpref$+str$(frm)+".jpg")
- shell("rm frames/"+tmpfpref$+str$(frm)+".bmp")
- frm+=1
- wend
- shell ("ffmpeg -i frames/"+tmpfpref$+"%d.jpg -target pal-dvd -s "+str$(xed)+"x"+str$(yed)+" "+fout$+".mpg")
- '- ffmpeg -i frames/_tmpr_%d.jpg -target pal-dvd -s 5120x2880 _final_2880p_.mpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement