View.Set ("offscreenonly")
%menu.t
colorback (23)
color (30)
var font1, font2, font3, font4, line : int
font1 := Font.New ("courier:10")
font2 := Font.New ("courier:10:bold")
%function mouseover
var mousex, mousey, mouseb, mousex1, mousey1, mouseb1, mousex2, mousey2, mouseb2, mousex3, mousey3, mouseb3 : int
function mouseover (x1, y1, x2, y2 : int) : boolean
var x, y, b : int
mousewhere (x, y, b)
if (x >= x1 and x <= x2) or (x >= x2 and x <= x1) then
if (y >= y1 and y <= y2) or (y >= y2 and y <= y1) then
result true
end if
end if
result false
end mouseover
drawfillbox (0, 0, 640, 400, 23)
loop
if mouseover (500, 300, 600, 320) then
drawfillbox (500, 300, 600, 320, 23)
drawbox (500, 300, 600, 320, black)
Font.Draw ("Play game", 505, 308, font1, black)
else
drawfillbox (500, 300, 600, 320, 27)
drawbox (500, 300, 600, 320, black)
Font.Draw ("Play game", 505, 308, font1, black)
end if
if mouseover (500, 295, 600, 275) then
drawfillbox (500, 295, 600, 275, 24)
drawbox (500, 295, 600, 275, black)
Font.Draw ("RULES", 505, 280, font1, black)
else
drawfillbox (500, 295, 600, 275, 27)
drawbox (500, 295, 600, 275, black)
Font.Draw ("RULES", 505, 280, font1, black)
end if
if mouseover (500, 270, 600, 250) then
drawfillbox (500, 270, 600, 250, 25)
drawbox (500, 270, 600, 250, black)
Font.Draw ("High Scores", 505, 255, font1, black)
else
drawfillbox (500, 270, 600, 250, 27)
drawbox (500, 270, 600, 250, black)
Font.Draw ("High Scores", 505, 255, font1, black)
end if
if mouseover (500, 245, 600, 225) then
drawfillbox (500, 245, 600, 225, 26)
drawbox (500, 245, 600, 225, black)
Font.Draw ("EXIT", 505, 230, font1, black)
else
drawfillbox (500, 245, 600, 225, 27)
drawbox (500, 245, 600, 225, black)
Font.Draw ("EXIT", 505, 230, font1, black)
end if
var button : int
button := 0
var x2, y3 : int
x2 := 450
y3 := 310
Mouse.Where (x2, y3, button)
if whatdotcolor (x2, y3) = 23 and button = 1 then
cls
drawfillbox (0, 0, 640, 400, 23)
var ans4: string
put "play"
get ans4
else
end if
var x3, y4 : int
x3 := 450
y4 := 285
Mouse.Where (x3, y4, button)
if whatdotcolor (x3, y4) = 24 and button = 1 then
cls
drawfillbox (0, 0, 640, 400, 23)
put " RULES"
put " ------"
put ""
put " The name of the game is blackjack."
put " Closest to 21 without going over, wins."
put " Aces are worth 1 and 11 pending if you're going over 21"
put " Face Cards are worth 10"
put " In Case of tie the dealer wins."
put " If player is over 21, they immediatly lose."
else
end if
var x4, y5 : int
x4 := 450
y5 := 265
Mouse.Where (x4, y5, button)
if whatdotcolor (x4, y5) = 25 and button = 1 then
cls
drawfillbox (0, 0, 640, 400, 23)
put " HIGH SCORES"
put " -----------"
put ""
put " 1. Benjamin evans Walker"
put " 2. Beedub"
put " 3. BlanG"
else
end if
var x5, y6 : int
x5 := 450
y6 := 245
Mouse.Where (x5, y6, button)
if whatdotcolor (x5, y6) = 26 and button = 1 then
cls
drawfillbox (0, 0, 640, 400, 23)
put "exit"
else
end if
View.Update
delay (5)
end loop
|