Blobs

Post Reply
User avatar
NightRadio
Site Admin
Posts: 2837
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Blobs

Post by NightRadio » Mon May 05, 2008 2:41 pm

Code: Select all

clear( BLACK )
MAKE_BLOB

start:
x = ( rand%320 ) - 160
y = ( rand%240 ) - 120
pixi( BLOB_IMG, x, y, rand&3, 0 )
frame( 50 )
go start

MAKE_BLOB:
BLOB_SIZE = 64
if BLOB_IMG = 0 
{ 
	BLOB_IMG = new_pixi( BLOB_SIZE, BLOB_SIZE, 1 ) 
	pixi_alpha( BLOB_IMG, BLOB_IMG )
	p = 0
	y = 0 while( y < BLOB_SIZE ) {
		x = 0 while( x < BLOB_SIZE ) {
			c1 = cos( ( (x-BLOB_SIZE/2)*2 * 256 ) / BLOB_SIZE ) / 2 + 128
			c2 = cos( ( (y-BLOB_SIZE/2)*2 * 256 ) / BLOB_SIZE ) / 2 + 128
			c = ( c1 * c2 ) / 256
			BLOB_IMG[ p ] = get_color( c, c, c )
			p + 1
			x + 1
		}
		y + 1
	}
}
ret
Attachments
blobs.JPG
blobs.JPG (6.93 KiB) Viewed 5433 times

User avatar
NightRadio
Site Admin
Posts: 2837
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Blobs with zoom

Post by NightRadio » Mon May 05, 2008 3:02 pm

Without noise:

Code: Select all

xsize = 320
ysize = 240

MAKE_BLOB

scr_cnt = 0
scr2 = new_pixi( xsize, ysize, 1 )

start:
if scr_cnt = 0 { 
	set_screen( scr2 )
	pixi( 0, 0, 0, 1, 8 )
} else {
	set_screen( 0 )
	pixi( scr2, 0, 0, 1, 8 )
}
scr_cnt + 1
scr_cnt & 1
x = ( rand%xsize ) - xsize/2
y = ( rand%ysize ) - ysize/2
pixi( BLOB_IMG, x, y, rand&3, 0 )
frame( 50 )
go start

MAKE_BLOB:
BLOB_SIZE = 64
if BLOB_IMG = 0 
{ 
	BLOB_IMG = new_pixi( BLOB_SIZE, BLOB_SIZE, 1 ) 
	pixi_alpha( BLOB_IMG, BLOB_IMG )
	p = 0
	y = 0 while( y < BLOB_SIZE ) {
		x = 0 while( x < BLOB_SIZE ) {
			c1 = cos( ( (x-BLOB_SIZE/2)*2 * 256 ) / BLOB_SIZE ) / 2 + 128
			c2 = cos( ( (y-BLOB_SIZE/2)*2 * 256 ) / BLOB_SIZE ) / 2 + 128
			c = ( c1 * c2 ) / 256
			BLOB_IMG[ p ] = get_color( c, c, c )
			p + 1
			x + 1
		}
		y + 1
	}
}
ret
With noise:

Code: Select all

xsize = 320
ysize = 240

MAKE_BLOB

scr_cnt = 0
scr2 = new_pixi( xsize, ysize, 1 )

start:
if scr_cnt = 0 { 
	set_screen( scr2 )
	pixi( 0, 0, 0, 1, 32 )
} else {
	set_screen( 0 )
	pixi( scr2, 0, 0, 1, 32 )
}
scr_cnt + 1
scr_cnt & 1
x = ( rand%xsize ) - xsize/2
y = ( rand%ysize ) - ysize/2
pixi( BLOB_IMG, x, y, rand&3, 0 )
effector( WHITE, 16, 0, -500, -500, 1000, 1000, 0 )
frame( 50 )
go start

MAKE_BLOB:
BLOB_SIZE = 64
if BLOB_IMG = 0 
{ 
	BLOB_IMG = new_pixi( BLOB_SIZE, BLOB_SIZE, 1 ) 
	pixi_alpha( BLOB_IMG, BLOB_IMG )
	p = 0
	y = 0 while( y < BLOB_SIZE ) {
		x = 0 while( x < BLOB_SIZE ) {
			c1 = cos( ( (x-BLOB_SIZE/2)*2 * 256 ) / BLOB_SIZE ) / 2 + 128
			c2 = cos( ( (y-BLOB_SIZE/2)*2 * 256 ) / BLOB_SIZE ) / 2 + 128
			c = ( c1 * c2 ) / 256
			BLOB_IMG[ p ] = get_color( c, c, c )
			p + 1
			x + 1
		}
		y + 1
	}
}
ret

Post Reply