procedure DrawHouse (StartX, StartY, EndX, EndY, Top, Col : int, Door : boolean)
if Door then
Draw.FillBox (((StartX + EndX) div 2) - 2, StartY, ((StartX + EndX) div 2) + 2, StartY + 5, brightred)
end if
Draw.Box (StartX, StartY, EndX, EndY, Col)
Draw.Line (StartX, EndY, (StartX + EndX) div 2, EndY + Top, Col)
Draw.Line (EndX, EndY, (StartX + EndX) div 2, EndY + Top, Col)
Draw.Line (StartX + 1, EndY, EndX - 1, EndY, white)
end DrawHouse
var x, y : int := 0
var xrad : int := 40
var yrad : int := 10
var border : int := black
loop
DrawHouse (x, y, x + xrad, y + yrad, yrad, border, true)
x += xrad
if x >= maxx then
x := 0
y += yrad * 2
end if
exit when y >= maxy
end loop
var picID : int := Pic.New (0, 0, maxx, maxy)
Mouse.ButtonChoose ("multibutton")
View.Set ("graphics;offscreenonly")
var mousex, mousey, button : int
loop
Mouse.Where (mousex, mousey, button)
Pic.Draw (picID, 0, 0, picCopy)
if button = 1 then
Draw.Fill (mousex, mousey, brightgreen, border)
end if
View.Update
end loop
|