var charwindow : int := Window.Open ("graphics:350;300,position:center;center,nobuttonbar")
var chars :array char of boolean
var col1, col2 : int :=1
colourback (green)
cls
%%%character choice
%player 1
locate (1, 18)
put "PLAYER 1"
locate (3, 1)
put "Please type the letter that represents the colour you want"
locate (6, 1)
put "green - g"
put "red - r"
put "yellow - y"
put "blue - b"
put "black - l"
put "pink - p"
put "press enter when done."
Font.Draw ("Example", 250, 200, defFontID, black)
loop
Input.KeyDown (chars)
if chars ('g') then
col1 := 2
elsif chars ('r') then
col1 := 40
elsif chars ('y') then
col1 := 14
elsif chars ('b') then
col1 := 9
elsif chars ('l') then
col1 := 7
elsif chars ('p') then
col1 := 8
end if
exit when chars (KEY_ENTER)
Draw.FillOval (275, 160, 30, 30, col1)
end loop
%player 2
View.Update
cls
locate (1, 18)
put "PLAYER 2"
locate (3, 1)
put "Please type the letter that represents the colour you want"
locate (6, 1)
put "green - g"
put "red - r"
put "yellow - y"
put "blue - b"
put "black - l"
put "pink - p"
put "press shift when done."
Font.Draw ("Example", 250, 200, defFontID, black)
loop
Input.KeyDown (chars)
if chars ('g') then
col2 := 2
elsif chars ('r') then
col2 := 40
elsif chars ('y') then
col2 := 14
elsif chars ('b') then
col2 := 9
elsif chars ('l') then
col2 := 7
elsif chars ('p') then
col2 := 8
elsif chars (KEY_ENTER) then
cls
end if
exit when chars (KEY_SHIFT)
Draw.FillOval (275, 160, 30, 30, col2)
end loop
%Window.Close (charwindow)
|