-----------------------------------
we64
Wed Feb 04, 2004 6:24 pm
Hangman Game 1.1v (updated button)
-----------------------------------
%Hangman Game 1.1 v.
%By Tony Zhang
setscreen ("graphics:1000;650")
var x, y, letter : int := 0
var colo : int
var fx, sx, tx : array 1 .. 11 of int := init (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
var words : array 1 .. 15 of string := init ("computer", "baseball", "program", "video", "cat", "dog", "tiger", "driver", "soccer", "radio", "music", "science", "king", "basketball", "chess")
var random, counter, right : int := 0
var word, choice, let : string := ""
process won
loop
Draw.Text ("YaY, You won!", maxx div 2 - 100, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (1, 100))
delay (500)
exit when choice = "y" or choice = "n"
end loop
end won
process lost
loop
Draw.Text ("You Lost!", maxx div 2 - 50, maxy div 2 - 50, Font.New ("serif:24:bold"), Rand.Int (155, 200))
Draw.Text ("The word was:", maxx div 2 - 150, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (155, 200))
Draw.Text (words (random), maxx div 2 + 60, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (155, 200))
delay (500)
exit when choice = "y" or choice = "n"
end loop
end lost
proc playagain
loop
if Mouse.ButtonMoved ("down") then
var buttonnumber, buttonupdown : int
Mouse.ButtonWait ("down", x, y, buttonnumber, buttonupdown)
if x >= maxx div 2 - 95 and x = maxy - 245 and y = maxx div 2 + 5 and x = maxy - 245 and y = 100 and tx (a) = 95 and x = 255 and y = 145 and x = 255 and y = 195 and x = 255 and y = 245 and x = 255 and y = 295 and x = 255 and y = 345 and x = 255 and y = 395 and x = 255 and y = 445 and x = 255 and y = 495 and x = 255 and y = 545 and x = 255 and y = 95 and x = 205 and y = 145 and x = 205 and y = 195 and x = 205 and y = 245 and x = 205 and y = 295 and x = 205 and y = 345 and x = 205 and y = 395 and x = 205 and y = 445 and x = 205 and y = 495 and x = 205 and y = 545 and x = 205 and y = 195 and x = 155 and y = 245 and x = 155 and y = 295 and x = 155 and y = 345 and x = 155 and y = 395 and x = 155 and y = 445 and x = 155 and y = 97 and ord (let) = 107 and ord (let) = 117 and ord (let) 96
end if
end loop
%Release
if ord (let) >= 97 and ord (let) = 107 and ord (let) = 117 and ord (let)