블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday

Category

2007. 7. 4. 16:30 Code/NodeBox


size(200,200)
speed(100)

def setup():
    global x
    global y
    global c
    global n

    c=range(16) #color of a cell
    n=range(16) #cell number
    
    for n in range(16):
        c[n]=0

def draw():
    global x
    global y
    global c
    global n

    x=MOUSEX
    y=MOUSEY
    s=50  #size of a cell
    b=1 #blue    

    
    for n in range(16):
        c[n]-=0.1
        
    for h in range(4):
        for w in range(4):
            n=h*4+w
            
            if ((x>=w*s)&(x<=(w+1)*s)) & ((y>=h*s)&(y<=(h+1)*s)):
                #if mousedown:
                c[n]=1

            if (n<=11) & (c[n]>0) & (c[n]<=0.1):
                c[n+4]=1                     

            stroke(1)
            fill(c[n],c[n],b)
            rect(w*s,h*s,s,s)

             

'Code > NodeBox' 카테고리의 다른 글

pop_test  (0) 2007.07.05
matrix_glimmer_dim  (0) 2007.07.04
matrix_color_chain  (0) 2007.06.27
matrix-color change  (0) 2007.06.27
matrix  (0) 2007.06.27
posted by maetel