http://www.teamrebellion.co.uk/pixelmorph.zip
This is a crap little gfx pixel type image thing ive done. I took and image cut it into blocks then scattered em, then I make em re form the image and then blow up again.
nofink special. what im wondering is if there is any way of making this faster. and would you mind showing me how ?
This is a crap little gfx pixel type image thing ive done. I took and image cut it into blocks then scattered em, then I make em re form the image and then blow up again.
nofink special. what im wondering is if there is any way of making this faster. and would you mind showing me how ?
; ; Pixel Morph Example. ; By Yavin ; ; Const gfx_width=640 Const gfx_height=480 Const gfx_bit=16 Const gfx_window=0 Graphics gfx_width,gfx_height,gfx_bit,gfx_window SetBuffer BackBuffer() Cls Type pixel Field frame Field image Field x# Field y# Field dx# Field dy# Field r Field g Field b Field dest_x# Field dest_y# End Type Global pixel_width% Global pixel_height% Const bit_size=5 Global pixelmap=LoadImage("yav.bmp") Global pw=ImageWidth(pixelmap) Global ph=ImageHeight(pixelmap) FreeImage pixelmap pixelmap=LoadAnimImage("yav.bmp",bit_size,bit_size,0,(pw/bit_size)*(ph/bit_size)):MaskImage pixelmap,255,0,255 Global pixel.pixel = New pixel : Delete pixel loadpixelmap() Global counter While Not KeyHit(1) Cls updatepixelmap() Drawpixelmap(250,250,True,pixelmap) Text 1,1,"Working" counter=counter+1 Flip If counter=1 Then WaitKey() If counter=100 Then WaitKey() Wend FreeImage pixelmap For pixel.pixel = Each pixel Delete pixel Next Function updatepixelmap() For pixel.pixel = Each pixel pixel\x=pixel\x+pixel\dx pixel\y=pixel\y+pixel\dy Next End Function Function drawpixelmap(x=0,y=0,Midhand=False,image) If Midhand=True Local midx,midy,width,height midx=pw/2 midy=ph/2 x=x-midx y=y-midy End If For pixel.pixel = Each pixel DrawImage pixelmap,pixel\x*bit_size,pixel\y*bit_size,pixel\frame ;DebugLog pixel\frame Next End Function Function loadpixelmap() ;Stop SeedRnd MilliSecs() Local row,col,fr fr=0 row=0 col=0 For looper=1 To (pw/bit_size)*(ph/bit_size) fr=fr+1 If row=>pw/bit_size col=col+1 row=0 End If pixel.pixel=New pixel pixel\x=Rnd(-(gfx_width/2),(gfx_width/2));gfx_width/bit_size) pixel\y=Rnd(-(gfx_height/2),(gfx_height/2));gfx_height/bit_size) pixel\frame=fr-1 pixel\dest_x=row pixel\dest_y=col pixel\dx= (pixel\dest_x-pixel\x)/100; pixel\dy= (pixel\dest_y-pixel\y)/100; row=row+1 Next End Function