블로그 이미지
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 31
  • total
  • today
  • yesterday

Category

'Code/NodeBox'에 해당되는 글 29건

  1. 2007.06.18 ping
  2. 2007.06.17 splash
  3. 2007.06.14 progress
  4. 2007.06.14 range()
2007. 6. 18. 01:32 Code/NodeBox

size(300,300)
speed(100)

def setup():
    global x
    global y
    global vx
    global vy
    
    x=150   #initial position
    y=150
    vx=10   #initial velocity
    vy=15
    
    
def draw():
    global x
    global y
    global vx
    global vy
    
    c=0.01  #viscosity
    r=1.1   #repulsive force
    
    ax=-vx*c
    ay=-vy*c
    vx+=ax
    vy+=ay
    x+=vx
    y+=vy

 
     
    if (x>WIDTH):
        vx*=-r
        x=WIDTH

    if (x<0):
        vx*=-r
        x=0

    if (y>HEIGHT):
        vy*=-r
        y=HEIGHT    

    if (y<0):
        vy*=-r
        y=0    

    oval(x,y,20,20) 

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

ping_class  (0) 2007.06.20
ping_multi  (0) 2007.06.18
splash  (0) 2007.06.17
progress  (0) 2007.06.14
range()  (0) 2007.06.14
posted by maetel
2007. 6. 17. 21:44 Code/NodeBox


size(300,300)
speed(150)

def setup():
    global frame
    global r

    frame = 0
    r=0

def draw():   
    global frame
    global r
    from math import sin, cos, radians

    frame += 1   
    y=frame*10
    x=WIDTH/2
           
    if y>=HEIGHT/2:
        r+=2
# 1)
        for a in range(0,12):
            ovalcen(x+r*cos(radians(a*30)), HEIGHT/2+r*sin(radians(a*30)), 10, 10)
# 2)
#        a=0           
#        while a<360:
#            a+=60
#            ovalcen(x+r*cos(radians(a)), HEIGHT/2+r*sin(radians(a)), 10, 10)
    else:
        fill(0,0,0)
        ovalcen(x, y, 20, 20)
           
    if r>=200:
        frame=0
        r=0
           
def ovalcen(cx,cy,w,h):
    x=cx-w/2
    y=cy-h/2
    oval(x,y,w,h)

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

ping_class  (0) 2007.06.20
ping_multi  (0) 2007.06.18
ping  (0) 2007.06.18
progress  (0) 2007.06.14
range()  (0) 2007.06.14
posted by maetel
2007. 6. 14. 18:18 Code/NodeBox


size(200,200)
speed(20)

def setup():
    global frame
    global y
    
    frame = 0
    y=0
     
     
def draw():    
    global frame
    global y
    
    frame += 1
    x=frame*10

    fill(0,0,0)
    rect (x, y, 10, 10)
            
    if x>WIDTH:
        frame=0
        y += 50
    if y>HEIGHT:
        frame=0    
        y=0  

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

ping_class  (0) 2007.06.20
ping_multi  (0) 2007.06.18
ping  (0) 2007.06.18
splash  (0) 2007.06.17
range()  (0) 2007.06.14
posted by maetel
2007. 6. 14. 16:26 Code/NodeBox
사용자 삽입 이미지

#1
for x in range(10):
    for y in range(10-x):        
        rect(x*10, y*10+10*x, 5, 5)


#2
for x in range(11):
    for y in range(11):
        if x<y:
            rect(x*10, y*10-10, 5, 5)      

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

ping_class  (0) 2007.06.20
ping_multi  (0) 2007.06.18
ping  (0) 2007.06.18
splash  (0) 2007.06.17
progress  (0) 2007.06.14
posted by maetel