_TITLE "Snow by Ken, Petr, Bplus and Johnno "
'create hill on my screen:
fcirc
400, _HEIGHT + 300, 500, &HFFBBCCDD'save current screen
'load shifts to array
S(sh).sz = 1
S(sh).sz = 2
S(sh).sz = 3
S(sh).sz = 4
S(sh).sz = 5
xy&
= ((S
(sh
).X
- 400) ^ 2) + ((S
(sh
).Y
+ S
(sh
).oy
- (_HEIGHT + 300)) ^ 2) 'Pythagorean theorem, snow patircle - hill center Restart sh
'my loop
i& = 0
i& = i& + 1
S(i&).X = S(i&).X + S(i&).dx
S(i&).Y = S(i&).Y + S(i&).dy + S(i&).oy
IF S
(i&
).Y
> _HEIGHT THEN Restart i&
'is snow am bottom? Return it back.
'hill colission detection:
xy&
= ((S
(i&
).X
- 400) ^ 2) + ((S
(i&
).Y
+ S
(i&
).oy
- (_HEIGHT + 300)) ^ 2) 'Pythagorean theorem, snow patircle - hill center fcirc S(i&).X, S(i&).Y, S(i&).sz, &HFFFFFFFF
fcirc S(i&).X, S(i&).Y, S(i&).sz, &HFFFFFFFF
S(i&).oy = S(i&).oy + 2
Restart i&
Radius
= ABS(R
): RadiusError
= -Radius: X
= Radius: Y
= 0 LINE (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF