var y2, x2, y4, x4 : int
%DayTime Procedure
procedure house2
%sky
colourback (brightblue)
cls
%grass
Draw.ThickLine (0, 0, maxx, 0, 45, green)
%grass hill
drawfilloval (maxx div 2, 0, maxx div 2, 40, green)
%body of house
Draw.ThickLine (234, 39, 234, 155, 2, black)
Draw.ThickLine (405, 39, 405, 155, 2, black)
Draw.ThickLine (233, 155, 405, 155, 2, black)
drawline (233, 38, 405, 38, black)
drawfill (311, 100, red, black)
%grass hill
drawfilloval (maxx div 2, 0, maxx div 2, 40, green)
%door
drawfillbox (300, 41, 338, 94, black)
%doorknob
drawfilloval (309, 64, 4, 4, grey)
%roof
Draw.ThickLine (234, 154, 319, 240, 3, black)
Draw.ThickLine (405, 155, 319, 240, 3, black)
drawfill (311, 184, 138, black)
%chimney
Draw.ThickLine (352, 208, 352, 240, 2, black)
Draw.ThickLine (372, 189, 372, 240, 2, black)
Draw.ThickLine (351, 240, 372, 240, 2, black)
drawfill (363, 223, 116, black)
%window
drawfillbox (248, 96, 292, 132, white)
drawfillbox (250, 98, 268, 112, yellow)
drawfillbox (250, 115, 268, 130, yellow)
drawfillbox (271, 98, 290, 112, yellow)
drawfillbox (271, 115, 290, 130, yellow)
%garage body
drawfillbox (132, 33, 232, 132, black)
drawfillbox (134, 33, 232, 130, 138)
%garage door
drawfillbox (148, 33, 218, 102, black)
drawfillbox (150, 33, 216, 100, grey)
%garage door lines
y4 := 33
for i : 1 .. 10
Draw.ThickLine (148, y4, 218, y4, 1, black)
y4 += 7
end for
%ground
Draw.ThickLine (0, 0, maxx, 0, 45, green)
drawfilloval (maxx div 2, 0, maxx div 2, 40, green)
%copy of window
var window : array 1 .. sizepic (248, 96, 293, 132) of int
takepic (248, 96, 293, 132, window)
drawpic (346, 96, window, 0)
%walkway
drawline (300, 40, 259, 0, black)
drawline (339, 40, 380, 0, black)
drawfill (358, 18, grey, black)
drawline (271, 11, 369, 11, black)
drawline (283, 22, 357, 22, black)
drawline (293, 33, 346, 33, black)
%driveway
drawline (149, 34, 108, 0, black)
drawline (218, 39, 259, 0, black)
drawline (149, 34, 218, 39, black)
drawfill (184, 14, black, black)
end house2
%DayTime With Garage Door Open Procedure
procedure house3
%sky
colourback (brightblue)
cls
%grass
Draw.ThickLine (0, 0, maxx, 0, 45, green)
%grass hill
drawfilloval (maxx div 2, 0, maxx div 2, 40, green)
%body of house
Draw.ThickLine (234, 39, 234, 155, 2, black)
Draw.ThickLine (405, 39, 405, 155, 2, black)
Draw.ThickLine (233, 155, 405, 155, 2, black)
drawline (233, 38, 405, 38, black)
drawfill (311, 100, red, black)
%grass hill
drawfilloval (maxx div 2, 0, maxx div 2, 40, green)
%door
drawfillbox (300, 41, 338, 94, black)
%doorknob
drawfilloval (309, 64, 4, 4, grey)
%roof
Draw.ThickLine (234, 154, 319, 240, 3, black)
Draw.ThickLine (405, 155, 319, 240, 3, black)
drawfill (311, 184, 138, black)
%chimney
Draw.ThickLine (352, 208, 352, 240, 2, black)
Draw.ThickLine (372, 189, 372, 240, 2, black)
Draw.ThickLine (351, 240, 372, 240, 2, black)
drawfill (363, 223, 116, black)
%window
drawfillbox (248, 96, 292, 132, white)
drawfillbox (250, 98, 268, 112, yellow)
drawfillbox (250, 115, 268, 130, yellow)
drawfillbox (271, 98, 290, 112, yellow)
drawfillbox (271, 115, 290, 130, yellow)
%garage body
drawfillbox (132, 33, 232, 132, black)
drawfillbox (134, 33, 232, 130, 138)
%garage door
drawfillbox (148, 33, 218, 102, black)
%headlights
drawfilloval (170, 52, 6, 6, yellow)
drawfilloval (197, 52, 6, 6, yellow)
%copy of window
var window : array 1 .. sizepic (248, 96, 293, 132) of int
takepic (248, 96, 293, 132, window)
drawpic (346, 96, window, 0)
%walkway
drawline (300, 40, 259, 0, black)
drawline (339, 40, 380, 0, black)
drawfill (358, 18, grey, black)
drawline (271, 11, 369, 11, black)
drawline (283, 22, 357, 22, black)
drawline (293, 33, 346, 33, black)
%driveway
drawline (149, 34, 108, 0, black)
drawline (218, 39, 259, 0, black)
drawline (149, 34, 218, 39, black)
drawfill (184, 14, black, black)
end house3
%Garage Opening
procedure garage
y4 := 33
for i : 1 .. 11
drawfillbox (150, 33, 216, y4, black)
%ground
Draw.ThickLine (0, 0, maxx, 0, 45, green)
drawfilloval (maxx div 2, 0, maxx div 2, 40, green)
%walkway
drawline (300, 40, 259, 0, black)
drawline (339, 40, 380, 0, black)
drawfill (358, 18, grey, black)
drawline (271, 11, 369, 11, black)
drawline (283, 22, 357, 22, black)
drawline (293, 33, 346, 33, black)
%driveway
drawline (149, 34, 108, 0, black)
drawline (218, 39, 259, 0, black)
drawline (149, 34, 218, 39, black)
drawfill (184, 14, black, black)
y4 += 7
delay (300)
end for
%headlights
drawfilloval (170, 52, 6, 6, yellow)
drawfilloval (197, 52, 6, 6, yellow)
delay (600)
end garage
x2 := 0
y2 := 40
for i : 1 .. 36
setscreen ("offscreenonly")
View.Update
house2
%fork smoke
%sun
drawfilloval (x2, y2, 20, 20, yellow)
x2 += 8
y2 += 10
delay (300)
end for
setscreen ("nooffscreenonly")
garage
for i : 1 .. 41
setscreen ("offscreenonly")
View.Update
house3
%fork smoke
%sun
drawfilloval (x2, y2, 20, 20, yellow)
%ground
Draw.ThickLine (0, 0, maxx, 0, 45, green)
drawfilloval (maxx div 2, 0, maxx div 2, 40, green)
%walkway
drawline (300, 40, 259, 0, black)
drawline (339, 40, 380, 0, black)
drawfill (358, 18, grey, black)
drawline (271, 11, 369, 11, black)
drawline (283, 22, 357, 22, black)
drawline (293, 33, 346, 33, black)
%driveway
drawline (149, 34, 108, 0, black)
drawline (218, 39, 259, 0, black)
drawline (149, 34, 218, 39, black)
drawfill (184, 14, black, black)
x2 += 8
y2 -= 10
delay (300)
end for
|