Computer Science Canada

Multiple Problems in my game I cant solve

Author:  mains50 [ Sat Jun 12, 2010 5:44 pm ]
Post subject:  Multiple Problems in my game I cant solve

What is it you are trying to achieve?
I am trying to solve the problem in my game. The game is millionaire


What is the problem you are having?
music wont play, after person looses a game the next screen wont show. And i dont know how to write the If statement for the help options, for example when the persons clicks the call a friend option i want to write the if statement for that.


Describe what you have tried to solve this problem
every thing i could think of




Turing:


<Add your code here>



Please specify what version of Turing you are using
4.1

Author:  BigBear [ Sat Jun 12, 2010 5:48 pm ]
Post subject:  RE:Multiple Problems in my game I cant solve

You are already checking where the mouse is when the user clicks you just got to make sure if it is within the play text than play otherwise check if it is within the instructions text and display the instructions.

Author:  mains50 [ Sat Jun 12, 2010 6:47 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

BigBear @ Sat Jun 12, 2010 5:48 pm wrote:
You are already checking where the mouse is when the user clicks you just got to make sure if it is within the play text than play otherwise check if it is within the instructions text and display the instructions.


how do u do that.. i am sorry but its just been 3 months since i am doing turing

Author:  Tony [ Sat Jun 12, 2010 8:39 pm ]
Post subject:  RE:Multiple Problems in my game I cant solve

You know the location of the mouse (you check for it), and you know the location of the text (since you draw it). You compare the numbers that describe those locations.

Author:  Cezna [ Sun Jun 13, 2010 9:21 am ]
Post subject:  RE:Multiple Problems in my game I cant solve

The title is spelt:
"Welcome to Millaonaire"
instead of:
"Welcome to Millionaire"

As for the problem of the lose screen not showing, it is due to this segment of the code:
Turing:

exit when correct = 11 or wrong = 1

    if correct = 11 then
        %Drawing the winning screen
        fork cheer
        drawbox (5, 420, 700, 220, 1)
        Draw.Text ("YOU WON THE GAME", 150, 500, titleFont, blue)
        Draw.Text (" Here is your cheuqe", 0, 400, textFont, blue)
        Draw.Text (" Please Enter your name:", 0, 370, textFont, blue)
        Draw.Text (" The money you won is", correct, 370, textFont, blue)

    elsif wrong = 1 then

        Draw.Text ("wrong", 810, 400, questionFont, black)
        Draw.FillOval (maxx div 2, maxy div 2, 175, 175, yellow)
        Draw.FillOval (maxx div 2 - 75, maxy div 2 + 45, 50, 50, black)
        Draw.FillOval (maxx div 2 + 75, maxy div 2 + 45, 50, 50, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 125, 100, 40, 140, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 124, 99, 40, 140, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 123, 98, 40, 140, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 122, 97, 40, 140, black)
        Draw.FillOval (maxx div 2 - 75, maxy div 2 + 45, 30, 30, red)
        Draw.FillOval (maxx div 2 + 75, maxy div 2 + 45, 30, 30, red)
        Draw.FillOval (maxx div 2 - 75, maxy div 2 + 45, 19, 19, brightred)
        Draw.FillOval (maxx div 2 + 75, maxy div 2 + 45, 19, 19, brightred)
    end if

end loop


It is exiting if wrong = 1, which dosn't allow it to get to the elsif wrong = 1 (which, from the code, looks like it draws a frowning face or something.
This section of code should be put in a seperate procedure which is called if wrong = 1, or the exit when wrong = 1 line should be removed.

Also, if the music that you can't get to play is the Audience.wav, then it should probably be:

Turing:

Music.PlayFileLoop ("Audience.Wav")


Instead of:

Turing:

Music.PlayFile ("Audience.Wav")


Music.PlayFileLoop does exactly what you would assume from it's name, it will continue to play the file until you stop it with:

Turing:


You do not need to specify the filename with Music.PlayFileStop.

If this is not the music you mean, then I think the problem may be your computer, since all of the music seemed to work fine for me.

Author:  mains50 [ Sun Jun 13, 2010 1:40 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

Cezna @ Sun Jun 13, 2010 9:21 am wrote:
The title is spelt:
"Welcome to Millaonaire"
instead of:
"Welcome to Millionaire"

As for the problem of the lose screen not showing, it is due to this segment of the code:
Turing:

exit when correct = 11 or wrong = 1

    if correct = 11 then
        %Drawing the winning screen
        fork cheer
        drawbox (5, 420, 700, 220, 1)
        Draw.Text ("YOU WON THE GAME", 150, 500, titleFont, blue)
        Draw.Text (" Here is your cheuqe", 0, 400, textFont, blue)
        Draw.Text (" Please Enter your name:", 0, 370, textFont, blue)
        Draw.Text (" The money you won is", correct, 370, textFont, blue)

    elsif wrong = 1 then

        Draw.Text ("wrong", 810, 400, questionFont, black)
        Draw.FillOval (maxx div 2, maxy div 2, 175, 175, yellow)
        Draw.FillOval (maxx div 2 - 75, maxy div 2 + 45, 50, 50, black)
        Draw.FillOval (maxx div 2 + 75, maxy div 2 + 45, 50, 50, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 125, 100, 40, 140, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 124, 99, 40, 140, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 123, 98, 40, 140, black)
        Draw.Arc (maxx div 2, maxy div 2 - 145, 122, 97, 40, 140, black)
        Draw.FillOval (maxx div 2 - 75, maxy div 2 + 45, 30, 30, red)
        Draw.FillOval (maxx div 2 + 75, maxy div 2 + 45, 30, 30, red)
        Draw.FillOval (maxx div 2 - 75, maxy div 2 + 45, 19, 19, brightred)
        Draw.FillOval (maxx div 2 + 75, maxy div 2 + 45, 19, 19, brightred)
    end if

end loop


It is exiting if wrong = 1, which dosn't allow it to get to the elsif wrong = 1 (which, from the code, looks like it draws a frowning face or something.
This section of code should be put in a seperate procedure which is called if wrong = 1, or the exit when wrong = 1 line should be removed.

Also, if the music that you can't get to play is the Audience.wav, then it should probably be:

Turing:

Music.PlayFileLoop ("Audience.Wav")


Instead of:

Turing:

Music.PlayFile ("Audience.Wav")


Music.PlayFileLoop does exactly what you would assume from it's name, it will continue to play the file until you stop it with:

Turing:


You do not need to specify the filename with Music.PlayFileStop.

If this is not the music you mean, then I think the problem may be your computer, since all of the music seemed to work fine for me.


Thanks that solved alot of problems, after i edit it there is another problem. When i get the question right it does not go to next question it just shows a white screen after. Also can you help me with the help optionlike is this the write code if somebody clicks the " Call a friend option"
%if lifeLine = call a friend then
cls
%Draw.Text ("Friend i need help", 810, 400, questionFont, black)

%end if

Author:  Cezna [ Sun Jun 13, 2010 3:11 pm ]
Post subject:  RE:Multiple Problems in my game I cant solve

I will have to go through the code some more to figure out the best way to do the help options, so I will post back on that in a while.

Also, if you want to post code, put this infront of the code in your post:
<code="Turing">
and this after:
</code>
except with square brackets (these ones [ ]), instead of triangle brackets (these ones < >).

As for the problem with the right screen after getting the right answer, I can only guess that that if statement was doing something else, but you will have to post your updated code for me to be able to give any meaningful help.

Author:  mains50 [ Sun Jun 13, 2010 3:59 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

Cezna @ Sun Jun 13, 2010 3:11 pm wrote:
I will have to go through the code some more to figure out the best way to do the help options, so I will post back on that in a while.

Also, if you want to post code, put this infront of the code in your post:
<code="Turing">
and this after:
</code>
except with square brackets (these ones [ ]), instead of triangle brackets (these ones < >).

As for the problem with the right screen after getting the right answer, I can only guess that that if statement was doing something else, but you will have to post your updated code for me to be able to give any meaningful help.


here is the updated code, also sometimes opening screen works other time it doesn't

Author:  USEC_OFFICER [ Sun Jun 13, 2010 6:21 pm ]
Post subject:  RE:Multiple Problems in my game I cant solve

Wait, sometimes it does or sometimes it doesn't? What error (if any) do you get? (Because it should always work or never work, not sometimes.)

Author:  mains50 [ Sun Jun 13, 2010 6:57 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

USEC_OFFICER @ Sun Jun 13, 2010 6:21 pm wrote:
Wait, sometimes it does or sometimes it doesn't? What error (if any) do you get? (Because it should always work or never work, not sometimes.)


there is no error, sometimes it shows the beginning screen other time it doesn't

Author:  Monduman11 [ Sun Jun 13, 2010 6:59 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

mains50 @ Sun Jun 13, 2010 6:57 pm wrote:
USEC_OFFICER @ Sun Jun 13, 2010 6:21 pm wrote:
Wait, sometimes it does or sometimes it doesn't? What error (if any) do you get? (Because it should always work or never work, not sometimes.)


there is no error, sometimes it shows the beginning screen other time it doesn't

huh??? lol i dont thinks that possible it either shows it or it doesnt. theres no middle ground for it showing or not

i tried running ur game and i cant cause i dont have eveything... if u want ppl to help with something u kinda have to include the stuff that we can test it with or else its just a bunch of code... for example your data file i have no idea what u wrote for it so i cant exactly help

Author:  mains50 [ Sun Jun 13, 2010 7:47 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

Monduman11 @ Sun Jun 13, 2010 6:59 pm wrote:
mains50 @ Sun Jun 13, 2010 6:57 pm wrote:
USEC_OFFICER @ Sun Jun 13, 2010 6:21 pm wrote:
Wait, sometimes it does or sometimes it doesn't? What error (if any) do you get? (Because it should always work or never work, not sometimes.)


there is no error, sometimes it shows the beginning screen other time it doesn't

huh??? lol i dont thinks that possible it either shows it or it doesnt. theres no middle ground for it showing or not

i tried running ur game and i cant cause i dont have eveything... if u want ppl to help with something u kinda have to include the stuff that we can test it with or else its just a bunch of code... for example your data file i have no idea what u wrote for it so i cant exactly help


oh that u should look it in my first post there is zip file that includes everything

Author:  Monduman11 [ Sun Jun 13, 2010 8:19 pm ]
Post subject:  RE:Multiple Problems in my game I cant solve

umm i looked at your game and for me the title screen works... only thing that doesnt work is i cant get past the second question. have u scripted it to go past the second question? cause whatever i click it just says wrong

Author:  mains50 [ Sun Jun 13, 2010 8:34 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

Monduman11 @ Sun Jun 13, 2010 8:19 pm wrote:
umm i looked at your game and for me the title screen works... only thing that doesnt work is i cant get past the second question. have u scripted it to go past the second question? cause whatever i click it just says wrong


thats werid the answer for the first one is 1939, there is also a code which is "question:+=1" -----> which shows the next question

Author:  Monduman11 [ Sun Jun 13, 2010 8:48 pm ]
Post subject:  RE:Multiple Problems in my game I cant solve

i know i got past the ww2 question its the soccer or football one that doest work

Author:  mains50 [ Sun Jun 13, 2010 9:01 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

Monduman11 @ Sun Jun 13, 2010 8:48 pm wrote:
i know i got past the ww2 question its the soccer or football one that doest work


the game does that sometimes, it says the write answers are wrong for some reason..

Author:  Monduman11 [ Sun Jun 13, 2010 9:05 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

mains50 @ Sun Jun 13, 2010 9:01 pm wrote:
Monduman11 @ Sun Jun 13, 2010 8:48 pm wrote:
i know i got past the ww2 question its the soccer or football one that doest work


the game does that sometimes, it says the write answers are wrong for some reason..

oh well thats a bug you have to fix then cause i tried all of the answers at least 4 times and it still said that their wrong

Author:  mains50 [ Sun Jun 13, 2010 11:43 pm ]
Post subject:  Re: RE:Multiple Problems in my game I cant solve

Monduman11 @ Sun Jun 13, 2010 9:05 pm wrote:
mains50 @ Sun Jun 13, 2010 9:01 pm wrote:
Monduman11 @ Sun Jun 13, 2010 8:48 pm wrote:
i know i got past the ww2 question its the soccer or football one that doest work


the game does that sometimes, it says the write answers are wrong for some reason..

oh well thats a bug you have to fix then cause i tried all of the answers at least 4 times and it still said that their wrong


the problem is i cant find the bug

Author:  Cezna [ Mon Jun 14, 2010 5:25 am ]
Post subject:  RE:Multiple Problems in my game I cant solve

While you are running the program, try putting in a break statement, and then use put to output the value of any variables involved.

break will stop the program, and the put statements will allow you to see what your variables are doing, which may give you some insight into what the problem is.

Another thing you might try is clicking pause to see what the program is doing at any given time, and then you can just click resume to continue.


: