%Ryan Murray TIK20
%October 8
%Snowman
setscreen ("offscreenonly")
procedure snowman (x, y : int, size : real)
drawfilloval (x, y, round (size * 100), round (size * 100), white)
drawfilloval (x, y + round (size * 155), round (size * 60), round (size * 60), white)
drawfilloval (x, y - round (size * 245), round (size * 150), round (size * 150), white)
drawfilloval (x, y, round (size * 7), round (size * 7), black)
drawfilloval (x, y + round (size * 50), round (size * 7), round (size * 7), black)
drawfilloval (x, y - round (size * 50), round (size * 7), round (size * 7), black)
drawfilloval (x - round (size * 20), y + round (size * 155), round (size * 7), round (size * 7), black)
drawfilloval (x + round (size * 20), y + round (size * 155), round (size * 7), round (size * 7), black)
drawfilloval (x, y + round (size * 140), round (size * 10), round (size * 3), 42)
drawfilloval (x, y + round (size * 120), round (size * 5), round (size * 5), black)
drawfilloval (x + round (size * 20), y + round (size * 123), round (size * 5), round (size * 5), black)
drawfilloval (x - round (size * 20), y + round (size * 123), round (size * 5), round (size * 5), black)
end snowman
procedure eraseSnowman (x, y : int, size : real)
drawfilloval (x, y - round (size * 245), round (size * 150), round (size * 150), 29)
drawfilloval (x, y + round (size * 155), round (size * 60), round (size * 60), blue)
end eraseSnowman
process motion (x : int)
var x1, x2 : real
x2 := 0.0
x1 := .1 + Rand.Real * .5
for i : 1 .. 50
eraseSnowman (x, 200, x2)
x2 := x2 + 0.01
snowman (x, 200, x2)
View.Update
delay (50)
end for
end motion
% MAIN PROGRAM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
colorback (29)
cls
drawfillbox (0, maxy div 2, maxx, maxy, blue)
fork motion(100)
fork motion (300)
fork motion (500)
var pos1 : int
var pos2 : int
var count : int
count := 0
loop
delay (10)
pos1 := Rand.Int (1, 640)
pos2 := Rand.Int (200, 480)
count := count + 1
drawfilloval (pos1, pos2, 1, 1, white)
View.Update
exit when count = 1000
end loop
|