Randomize Timer Const NB_BLOBS = 20 Const SPEED = 5 Type BlobT as single x,y,r as single vx,vy,vr as integer cr,cg,cb end type Screenres 320,240,32,2 Dim shared as BlobT Blob(NB_BLOBS-1) Dim shared as uinteger ptr scrptr,realscrptr dim shared as single t scrptr = Callocate(320*240,sizeof(Uinteger)) realscrptr = screenptr Sub MoveBlobs() static as single r1 for k as integer = 0 to NB_BLOBS-1 r1 = rnd if rnd<.07 then blob(k).vx = SPEED*cos(r1*6.283) if rnd<.07 then blob(k).vy = SPEED*sin(r1*6.283) blob(k).x += blob(k).vx blob(k).y += blob(k).vy if blob(k).x>320 or blob(k).x<0 then blob(k).x-=blob(k).vx : blob(k).vx = -blob(k).vx if blob(k).y>240 or blob(k).y<0 then blob(k).y-=blob(k).vy : blob(k).vy = -blob(k).vy next End sub Sub DrawBlobs() '' idée : interpolation de couleurs entre chaque blob static as single sum, xp,yp, xp2,yp2 for i as integer = 0 to 319 for j as integer = 0 to 239 sum = 0 for k as integer = 0 to NB_BLOBS-1 xp = (i-blob(k).x)*(i-blob(k).x) yp = (j-blob(k).y)*(j-blob(k).y) sum += blob(k).r/(.03*(xp + yp + 5*(blob(k).vx*blob(k).vx + blob(k).vy*blob(k).vy))) if sum > 1 then sum = 1 next sum = sum*255 ScrPtr[i+j*320] = rgb(sum*.9,sum*.85,sum) next next end sub Sub Magnify_Blobs() static as integer newx,newy,intensity static as single calc For i as integer = -160 to 159 For j as integer = -120 to 119 '' === Mercury stuff === realscrptr[(i+160)+(j+120)*320] = scrptr[(i+160)+(j+120)*320] intensity = scrptr[(i+160)+(j+120)*320] and 255 newx = i*(sqr(i*i+j*j)*.001)*.0001 * intensity *i*i newy = j*(sqr(i*i+j*j)*.001)*.0001 * intensity *j*j '' ===================== '' === squared stuff === 'realscrptr[(i+160)+(j+120)*320] = scrptr[(i+160)+(j+120)*320] 'intensity = scrptr[(i+160)+(j+120)*320] and 255 'newx = i*(exp(((i*i-160)*.001)))*.05 'newy = j*(exp(((j*j-120)*.001)))*.05 '' ===================== '' === magnification === 'calc = .000017*(i*i+j*j+17000) 'newx = i*calc 'newy = j*calc '' ===================== if newx+160>=0 and newx+160<320 then if newy+120>=0 and newy+120<240 then realscrptr[(i+160)+(j+120)*320] = scrptr[(newx+160)+(newy+120)*320] end if end if next next End sub Sub InitBlobs() For k as integer = 0 to NB_BLOBS-1 blob(k).r = .05+5*rnd*exp(rnd*.5) blob(k).x = 320*rnd blob(k).y = 240*rnd blob(k).vx = SPEED*(1-2*rnd) blob(k).vy = SPEED*(1-2*rnd) next End sub initBlobs Do MoveBlobs DrawBlobs screenlock : cls magnify_Blobs Screenunlock : sleep 1,1 Loop until multikey(&h01) deallocate scrptr