Author Topic: Tannen Baum  (Read 1952 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Tannen Baum
« on: December 03, 2015, 01:13:36 PM »
Hello,
Christmas is approaching, here is your first Christmas tree.  ;D
Code: [Select]
include "asm.inc"
Window 440,460,1

cls 255,255,255
loadimage "bmp/landschaft.bmp"
drawimage 1,0,0

single ra, fra 
sys bpx=220, bpy=410, tpx, tpy
sys  ht, xs, aa, ms=-100
sys tpxx, tpyy, bpxx, bpyy, minus4=-4
tpx = bpx

For aa=minus4 to 4
    bpxx=bpx+aa
    bpyy=bpy-390
    color 30,100,0
    Line bpxx, bpy, bpx, bpyy
Next
 
ra = 160
tpy = bpy-40

For ht=1 to 40
For xs=ms to 100 step 40
    xsh = xs/100 
    rs = Rand(0,3)/10
    tpxx = tpx+(xsh*ra)
    tpyy = tpy-rs*ra
    color 30,120,40
    Line tpx, tpy, tpxx, tpyy
    For aa=1 to 30
        fra=rand(0,9)/10*ra
        x1=tpx+(xsh*fra)
        y1=tpy-rs*fra
        x2=tpx+xsh*(fra+ra/5)
        y2=tpy-rs*fra+(-rs+(Rand(0,8)/10-0.4))*(ra/5)
        Line x1, y1, x2, y2 
    Next
Next
ra -=4
tpy -=9
Next

WaitKey
WinEnd

.