
-----------------------------------
StarXu
Sat Jan 16, 2010 3:34 pm

Quiz Game HELP: Continue to next Procedure?
-----------------------------------
What is it you are trying to achieve?
Continue on to the next procedure if the user clicks in the specified area by using Mouse.Where


What is the problem you are having?
I can't continue onto the next question/procedure


Describe what you have tried to solve this problem
I tried using a "return" statement to return to the original loop with the 1st and 2nd question in it but it doesn't work...


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




import GUI

%DECLARE VARIABLES---------------------------------------------------------------------------------------------------------
%windows
var winID, winL1, winL2, winL3, winCredits, winInstruct : int
%mouse.where
var x, y, b, b1 : int
%pictures
%backgrounds
var picSplash : int := Pic.FileNew ("Splash Screen.jpg")
var picLevel : int := Pic.FileNew ("Level.jpg")


%Questions Level 1
var pic1q0 : int := Pic.FileNew ("Q1-0.jpg")
var pic1q1 : int := Pic.FileNew ("Q1-1.jpg")
var pic1q2 : int := Pic.FileNew ("Q1-2.jpg")
var pic1q3 : int := Pic.FileNew ("Q1-3.jpg")


%font
var fontBradley : int := Font.New ("Bradley Hand ITC:25:bold")
var fontBradleyS : int := Font.New ("Bradley Hand ITC:15:bold")


%Moving Variables
var z : int := 0
var z1, z2, z3, z4 : int


%Radio Buttons
var radio : array 1 .. 5 of int %In order for the radio to be connected it has to be in an array
var pointsC : int := 3
var points : string
var totalPoints : int := 0
var questionCounter : int := 0
var qCounter : string
var correct : int := 0

var level : int := 0


%OPEN WINDOWS--------------------------------------------------------------------------------------------------------------
winID := Window.Open ("position:center;center,graphics:800;600")
View.Set ("title:Music Play")
winL1 := Window.Open ("position:center;center,graphics:800;600")
View.Set ("title:Level 1")
Pic.Draw (picLevel, 0, 0, picCopy)
winL2 := Window.Open ("position:center;center,graphics:800;600")
View.Set ("title:Level 2")
Pic.Draw (picLevel, 0, 0, picCopy)
winL3 := Window.Open ("position:center;center,graphics:800;600")
View.Set ("title:Level 3")
Pic.Draw (picLevel, 0, 0, picCopy)
winCredits := Window.Open ("position:center;center,graphics:800;600")
View.Set ("title:Credits")
Pic.Draw (picLevel, 0, 0, picCopy)
winInstruct := Window.Open ("position:center;center,graphics:800;600")
View.Set ("title:Instructions")
Pic.Draw (picLevel, 0, 0, picCopy)

%Hide the windows
Window.Hide (winL1)
Window.Hide (winL2)
Window.Hide (winL3)
Window.Hide (winCredits)
Window.Hide (winInstruct)
Window.SetActive (winID)



%PROCEDURES----------------------------------------------------------------------------------------------------------------
proc p1
    if pointsC = 0 then
        Pic.Draw (pic1q0, 0, 0, picCopy)
        GUI.Disable (radio (1))
    elsif pointsC = 1 then
        Pic.Draw (pic1q1, 0, 0, picCopy)
    elsif pointsC = 2 then
        Pic.Draw (pic1q2, 0, 0, picCopy)
    elsif pointsC = 3 then
        Pic.Draw (pic1q3, 0, 0, picCopy)
    else
    end if
    GUI.Refresh
    if radio (1) = GUI.GetEventWidgetID then
        locate (2, 1)
        Music.Play ("4>>ed+ed+edc>ed+ed+edc>ed+ed+edc1ced+ed+edc1ced+ed+edcc