2007. 7. 5. 14:28
Code/NodeBox
size(400,400)
speed(15)
def setup():
global mx
global my
global x
global y
global n
global d
global f
global s
global r
d=10 #distance
s=15 #initial size
r=0.8 #ratio of size decreasing
f=0 #frame
n=range(8)
x=range(8)
y=range(8)
def draw():
global mx
global my
global x
global y
global n
global d
global f
global s
global r
mx=MOUSEX
my=MOUSEY
rect(mx,my,s,s)
f+=1
x[0]=mx+f*d
y[0]=my
x[1]=mx+f*d
y[1]=my+f*d
x[2]=mx
y[2]=my+f*d
x[3]=mx-f*d
y[3]=my+f*d
x[4]=mx-f*d
y[4]=my
x[5]=mx-f*d
y[5]=my-f*d
x[6]=mx
y[6]=my-f*d
x[7]=mx+f*d
y[7]=my-f*d
for n in range(8):
rect(x[n],y[n],s*(r**f),s*(r**f))
if f>10: #term
f=1
speed(15)
def setup():
global mx
global my
global x
global y
global n
global d
global f
global s
global r
d=10 #distance
s=15 #initial size
r=0.8 #ratio of size decreasing
f=0 #frame
n=range(8)
x=range(8)
y=range(8)
def draw():
global mx
global my
global x
global y
global n
global d
global f
global s
global r
mx=MOUSEX
my=MOUSEY
rect(mx,my,s,s)
f+=1
x[0]=mx+f*d
y[0]=my
x[1]=mx+f*d
y[1]=my+f*d
x[2]=mx
y[2]=my+f*d
x[3]=mx-f*d
y[3]=my+f*d
x[4]=mx-f*d
y[4]=my
x[5]=mx-f*d
y[5]=my-f*d
x[6]=mx
y[6]=my-f*d
x[7]=mx+f*d
y[7]=my-f*d
for n in range(8):
rect(x[n],y[n],s*(r**f),s*(r**f))
if f>10: #term
f=1
so far, easy.
'Code > NodeBox' 카테고리의 다른 글
popping_0.0 (0) | 2007.07.06 |
---|---|
storing_test (0) | 2007.07.05 |
matrix_glimmer_dim (0) | 2007.07.04 |
matrix-glimmer (0) | 2007.07.04 |
matrix_color_chain (0) | 2007.06.27 |