setscreen ("graphics:max;max")
proc paint
var x, y, button : int
var xrdi, yrdi : int
var xrdi2, yrdi2 : int
var clrbr : int
var keys : array char of boolean
xrdi := 2
yrdi := 3
xrdi2 := 10
yrdi2 := 10
clrbr := 7
loop
if xrdi <= 0 then
xrdi := 2
yrdi := 3
end if
drawfilloval (20, 20, xrdi, yrdi, clrbr)
Input.KeyDown (keys)
if keys (KEY_UP_ARROW) then
xrdi := xrdi + 4
yrdi := yrdi + 4
drawfilloval (20, 20, xrdi, yrdi, clrbr)
delay (500)
end if
if keys (KEY_DOWN_ARROW) then
drawfilloval (20, 20, xrdi, yrdi, white)
xrdi := xrdi - 4
yrdi := yrdi - 4
drawfilloval (20, 20, xrdi, yrdi, clrbr)
delay (500)
end if
if keys (KEY_DELETE) then
delay (500)
cls
end if
if keys (KEY_ENTER) then
delay (500)
exit
end if
Mouse.Where (x, y, button)
Mouse.ButtonChoose ("multibutton")
if button = 1 then
drawfilloval (x, y, xrdi, yrdi, clrbr)
end if
if button = 10 then
if clrbr <= 16 then
clrbr := clrbr + 1
drawfilloval (20, 20, xrdi, yrdi, clrbr)
delay (500)
else
clrbr := 7
drawfilloval (20, 20, xrdi, yrdi, clrbr)
delay (500)
end if
end if
if button = 100 then
drawfilloval (x, y, xrdi2, yrdi2, white)
end if
end loop
end paint
put "TEST PAINT PROGRAM FOR E-CARD PROJECT"
put "Left Mouse Button - Draw"
put "Right Mouse Button - Erase"
put "Middle Mouse Button - Change Colour"
put "Up Arrow on Keyboard - Increase Brush Size"
put "Down Arrow on Keyboard - Decrase Brush Size"
put "Delete Key - Clears Screen"
put "Enter Key - Exits Program"
put ""
put "Note: Circle in bottom left corner tells you your brush size and colour."
delay (5000)
cls
paint
|