I Basic











DEF w:WINDOW
DEF cacheDC as INT
DEF rise, rad, frad, xshorten:float
DEF left, top, width, height, bpx, bpy, tpx, tpy:int
DEF x1, y1, x2, y2:int
WINDOW w, 20, 5, 440, 460, @caption, 0, "Merry Christmas", main


setwindowcolor w, rgb(255,235,190)
brown=rgb(130, 100, 0)
green=rgb(0, 80+rnd(40), 0)
'== GROW ===================
cacheDC = GetHDC(w)

bpx=220 : bpy=410 : tpx=bpx
for aa=-4 to 4
  line w, bpx+aa, bpy, bpx, bpy-390, brown
next aa
rad=160: tpy=bpy-40
for ht=1 to 40
  for xs=-100 to 100 #40
    xshorten=xs/100
    rise=rnd(.3)
    line w, tpx, tpy, tpx+(xshorten*rad), tpy-rise*rad, rgb(0,80+rnd(40),0)
    for aa=1 to 30
       frad=rnd(.9)*rad
       x1=tpx+(xshorten*frad)
       y1=tpy-rise*frad
       x2=tpx+xshorten*(frad+rad/5)
       y2=tpy-rise*frad+(-rise+(rnd(.8)-.4))*(rad/5)
       line w, x1, y1, x2, y2, rgb(0, 80+rnd(40), 0)
       'wait 1
    next aa
  next xs
  rad=rad-4 : tpy=tpy-9
next ht




ReleaseHDC(w,cacheDC)

'== DECORATE ======================
rad=160 : tpy=bpy-50
for ht=1 to 37
  circle w, tpx+rnd(2*rad)-rad, tpy+rnd(6)-3, 5, rgb(255,0,0),rgb(255,0,0)
  rad=rad-4 : tpy=tpy-9
next ht
'== DRAW BORDER ===========================
getclientsize w,left,top,width,height
setlinestyle w, @lssolid, 3
rect w, left+2, top+2, width-4, height-4, rgb(255,0,0)
rect w, left+5, top+5, width-10, height-10, rgb(0,120,0)
rect w, left+8, top+8, width-16, height-16, rgb(0,120,0)
rect w, left+11, top+11, width-22, height-22, rgb(255,0,0)
'== GREETING ==============================
setfont w, "times", 14, 700, @sfitalic
frontpen w, rgb(0,120,0)
move w, left+30, top+20 : print w, "Merry"
move w, left+20, top+50 : print w, "Christmas"

run = 1: WAITUNTIL run = 0: CLOSEWINDOW w: END

SUB main
SELECT @CLASS
  CASE @IDCLOSEWINDOW
    run = 0
ENDSELECT
RETURN



No hay comentarios:

Publicar un comentario

Nota: solo los miembros de este blog pueden publicar comentarios.