블로그 이미지
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

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