% Program by Himel Don for Mrs. Spangler's Computer Class
% Made during January 10th, 2007 and January 17th, 2007
% Culminating Project
setscreen ("graphics:600;500,position:center;center,nobuttonbar,nocursor,noecho,title:Himel's Culminating Project!")
%All user input variables are declared
var selection : int
var return1, return2 : string
%All window variables are declared
var iWindow : int := Window.Open ("graphics:600;500")
var winID1 : int
var winID2 : int
var winID3 : int
var winID4 : int
%Picture and font variables are declared
var picture : int := Pic.FileNew ("enRAGEd_cover.jpg")
var picture2 : int := Pic.FileNew ("enRAGED_covermenu.jpg")
var picture3 : int := Pic.FileNew ("enRAGED_coverhistory.jpg")
var picture4 : int := Pic.FileNew ("enRAGED_coverquiz.jpg")
var picture5 : int := Pic.FileNew ("enRAGED_covergallery.jpg")
var picture6 : int := Pic.FileNew ("gal1.jpg")
var picture7 : int := Pic.FileNew ("gal2.jpg")
var picture8 : int := Pic.FileNew ("gal3.jpg")
var picture9 : int := Pic.FileNew ("gal4.jpg")
var picture10 : int := Pic.FileNew ("gal5.jpg")
var picture11 : int := Pic.FileNew ("gal6.jpg")
var picture12 : int := Pic.FileNew ("gal7.jpg")
var picture13 : int := Pic.FileNew ("gal8.jpg")
var picture14 : int := Pic.FileNew ("enRAGED_coverquotes.jpg")
var font1 := Font.New ("Impact:11")
var font2 := Font.New ("Monotype Corsiva:10")
process playstuff
loop
Music.PlayFile ("Killing_In_The_Name_Of.MID")
end loop
end playstuff
%Process that plays opening music
process play1
sound (440, 500)
sound (400, 500)
sound (500, 500)
sound (360, 500)
sound (440, 500)
sound (400, 500)
sound (500, 500)
sound (360, 500)
end play1
%Procedure for the quiz window.
%Everytime a question is answered
%this quizrefresh procedure
%is called upon.
procedure quizrefresh
var x1, y1, x2, y2 : int
winID2 := Window.Open ("graphics:500;400;nobuttonbar,title:Quiz,;position:top;left")
Window.Select (winID2)
Window.SetActive (winID2)
Pic.Draw (picture4, 0, 0, 0)
for i : 1 .. 200
Window.GetPosition (winID2, x1, y1)
Window.Set (winID2, "position:" + intstr (x1) + "," + intstr (y1 - 1))
delay (10)
end for
end quizrefresh
%Procedure for the gallery
%slideshow.
procedure gallery
Pic.Draw (picture6, 90, 90, 0)
delay (4500)
Pic.Draw (picture7, 90, 90, 0)
delay (4500)
Pic.Draw (picture8, 90, 90, 0)
delay (4500)
Pic.Draw (picture9, 90, 90, 0)
delay (4500)
Pic.Draw (picture10, 90, 90, 0)
delay (4500)
Pic.Draw (picture11, 90, 90, 0)
delay (4500)
Pic.Draw (picture12, 90, 90, 0)
delay (4500)
Pic.Draw (picture13, 90, 90, 0)
end gallery
%Fork command to play opening music
fork play1
%Draws first screen picture
Pic.Draw (picture, 0, 0, 0)
%Delay for viewer to be allowed reasonable amount of time
%to view opening picture
delay (4000)
%Clears screen for main menu area
cls
%This procedure allows the user to navigate to and from each page.
procedure mainmenu
fork playstuff
%Second screen contains header and instructions
Pic.Draw (picture2, 0, 0, 0)
%Instructions text
Font.Draw ("This is the main menu. Read below for choices.", 167, 360, font1, black)
Font.Draw ("After picking choice, please type selected choice.", 160, 345, font1, black)
Font.Draw ("Please note that typed character will not appear.", 160, 330, font1, black)
Font.Draw ("Typed character will still be recognized by program.", 155, 315, font1, black)
%User inputs which 'page' they want to go to
get selection
%If statements which lead to next pages
if selection = 1 then
% Variables for x and y coordinates set
var x1, y1, x2, y2 : int
%Window one attributes set
winID1 := Window.Open ("graphics:500;400;nobuttonbar,noecho,nocursor,title:History,;position:top;right")
%Selects winID1
Window.Select (winID1)
%Sets winID1 as the active window
Window.SetActive (winID1)
%Draws background picture
Pic.Draw (picture3, 0, 0, 0)
%Looping instruction which causes the window
%to move down via X(1,2) and Y(1,2) coordinates
for i : 1 .. 200
Window.GetPosition (winID1, x1, y1)
Window.Set (winID1, "position:" + intstr (x1) + "," + intstr (y1 - 1))
delay (10)
end for
get return1
if return1 = "1" then
Window.Close (Window.GetActive)
mainmenu
elsif return1 = "no" then
put "Okay."
end if
elsif selection = 2 then
quizrefresh
get return1
if return1 = "exit" then
Window.Close (Window.GetActive)
mainmenu
elsif return1 = "1" then
put "Okay."
end if
elsif selection = 3 then
var x1, y1, x2, y2 : int
winID3 := Window.Open ("graphics:500;400;nobuttonbar,noecho,nocursor,title:Gallery,;position:top;left")
Window.Select (winID3)
Window.SetActive (winID3)
Pic.Draw (picture5, 0, 0, 0)
get return1
if return1 = "1" then
gallery
cls
Window.Close (Window.GetActive)
winID3 := Window.Open ("graphics:500;400;nobuttonbar,noecho,nocursor,title:Gallery,;position:top;left")
Window.Select (winID3)
Window.SetActive (winID3)
Pic.Draw (picture5, 0, 0, 0)
get return2
if return2 = "2" then
gallery
cls
Window.Close (Window.GetActive)
winID2 := Window.Open ("graphics:500;400;nobuttonbar,noecho,nocursor,title:Gallery,;position:top;left")
Window.Select (winID3)
Window.SetActive (winID3)
Pic.Draw (picture5, 0, 0, 0)
Font.Draw ("Maximum views reached. Returning to Menu.", 167, 360, font1, white)
delay (1000)
Window.Close (Window.GetActive)
mainmenu
elsif return2 = "1" then
gallery
cls
Window.Close (Window.GetActive)
winID2 := Window.Open ("graphics:500;400;nobuttonbar,noecho,nocursor,title:Gallery,;position:top;left")
Window.Select (winID3)
Window.SetActive (winID3)
Pic.Draw (picture5, 0, 0, 0)
Font.Draw ("Maximum views reached. Returning to Menu.", 135, 150, font1, white)
delay (2000)
Window.Close (Window.GetActive)
mainmenu
else
Window.Close (Window.GetActive)
mainmenu
end if
else
Window.Close (Window.GetActive)
mainmenu
end if
elsif selection = 4 then
var x1, y1, x2, y2 : int
winID4 := Window.Open ("graphics:500;400;nobuttonbar,noecho,nocursor,title:Quotes,;position:center")
Window.Select (winID4)
Window.SetActive (winID4)
Pic.Draw (picture14, 0, 0, 0)
get return1
if return1 = "1" then
Window.Close (Window.GetActive)
mainmenu
else
Window.Close (Window.GetActive)
mainmenu
end if
elsif selection = 5 then
Window.Close (iWindow)
end if
%Ends procedure. Procedure contains entire program for full access when called upon.
end mainmenu
%Mainmenu procedure called upon.
%This is the original main menu
%that the user sees.
mainmenu
|