-
Notifications
You must be signed in to change notification settings - Fork 0
/
OutroScreen.t
68 lines (51 loc) · 2.11 KB
/
OutroScreen.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Programmer:
%Date:
%Course: ICS3CU1
%Teacher:
%Program Name:
%Descriptions: Demos how to implement a button and a process
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% main procedure to handle the intro window
procedure displayOutroWindow
var Player1String, Player2String : string
Player1String := PlayerOneName + " is Victorious"
Player2String := PlayerTwoName + " is Victorious"
% flag that intro screen is open - global var isIntroWindowOpen
isGameWindowOpen := true
% Open the window and set as active
winoutID := Window.Open ("position:top;center,graphics:1024;800,title:EndScreen - Game Over")
Window.SetActive (winoutID)
%program to show a logo picture
displayEndGame
var pic : int
if Winnerisblack = true then
pic := Pic.FileNew ("files/images/outroscreenblack.jpg")
elsif Winnerisblack = false then
pic := Pic.FileNew ("files/images/outroscreenwhite.jpg")
end if
Pic.Draw (pic, 0, 0, 0)
fork outroMusic
%main title
% create a button
var quitOutroWindowButton := GUI.CreateButton (maxx - 100, 25, 0, "Quit", quitgame)
GUI.SetColor (quitOutroWindowButton, white)
var playagainWindowButton := GUI.CreateButton (250, 25, 0, "Play Again", playagainbuttonpressed)
GUI.SetColor (playagainWindowButton, white)
var displaySoundButton := GUI.CreateButton (maxx - 270, 25, 0, "Music On/Off", displaySoundButtonPressed)
GUI.SetColor (displaySoundButton, white)
%var displayStartGame := GUI.CreateButton (maxx - 250, maxy div 1, 0, "Start the Game", displayStartGame)
if Winnerisblack = true then
Font.Draw (Player1String, 50, 700, introfont, white)
elsif Winnerisblack = false then
Font.Draw (Player2String, 50, 700, introfont, white)
end if
%Hall of Fame : High Scores
%Hall of Shame : lost to easy AI
% Window will continue until quit button is pressed
loop
exit when GUI.ProcessEvent or isIntroWindowOpen = false
end loop
% release the button
GUI.Dispose (quitOutroWindowButton)
end displayOutroWindow