setscreen ("nobuttonbar")
View.Update
% Player Colors
var mx, my, mb : int
var prettycolor : array 1 .. 6 of int
prettycolor (1) := 12 % Red
prettycolor (2) := 9 % Blue
prettycolor (3) := 47 % Green
prettycolor (4) := 14 % Yellow
prettycolor (5) := 42 % Orange
prettycolor (6) := 35 % Purple
% Number of players
var plrnomax : int
put "Enter Number of players (2-6): " ..
get plrnomax
cls
% Fonts
setscreen ("graphics:150;480,nobuttonbar,offscreenonly,title: Ownership")
var statext : int
statext := Font.New ("Times:8")
% Drawing
for i : 0 .. 39
drawfillbox (10, maxy - (((i + 1) * 10) - 2), 4, maxy - ((i * 10) + 2), prettycolor ((i mod plrnomax) + 1))
drawbox (10, maxy - (((i + 1) * 10) - 2), 4, maxy - ((i * 10) + 2), black)
% For Text Height fiddle with this number *
Font.Draw ("Country " + intstr (i), 15, maxy - (((i + 1) * 10) - 2), statext, black)
% For Text Height fiddle with this number *
Font.Draw (intstr (Rand.Int (1, 12)) + " Armies", 80, maxy - (((i + 1) * 10) - 2), statext, black)
end for
View.Update
loop
mousewhere (mx, my, mb)
if mb = 1 then
for j : 1 .. 6
if whatdotcolor (mx, my) = prettycolor (j) then
drawfillbox (15, 15, 100, 30, 0)
Font.Draw ("Player " + intstr (j), 15, 15, statext, black)
View.Update
end if
end for
end if
end loop
|