Posted: Fri Feb 15, 2008 5:23 pm Post subject: Ending Music
I have a game i am working on and is almost finished I had music in it using Music.PlayFile but now I want it to be old school and have retro music using Sound or Turing's Play commands. However I used to Music.PlayFileStop and that worked fine but now I really need help ending the game music when I return to the main menu.
code:
var done := false
var word : string
var ans : string (1)
process DoMusic
loop
Music.Play ("cdefgabcbagfedg")
Music.Play ("cdefgabcbagfedg")
Music.Play ("cdefgabcbagfedg")
Music.Play ("cdefgabcbagfedg")
Music.Play ("cdefgabcbagfedg")
if done = true then
Music.SoundOff
end if
exit when done = true
end loop
end DoMusic
proc Play
fork DoMusic
loop
put "Enter q to quit"
put "Enter a word : " ..
get word
put word, " is a good word."
exit when word = "q"
end loop
Music.SoundOff
done := true
end Play
proc main
loop
put "Enter 1 to play"
put "1 Play"
getch (ans)
if ans = "1" then
Play
end if
exit when ans = "q"
end loop
end main
main
I made this program to demonstrate my problem. This would work if I had one Play command but I am wondering if there is another way? And when I put all my Play commands in one an error says "String literal is too large"
Sponsor Sponsor
BigBear
Posted: Sat Feb 16, 2008 11:32 am Post subject: Re: Ending Music
I have made most of my music on one line but still need a solution. Any Idea's
Clayton
Posted: Sat Feb 16, 2008 12:40 pm Post subject: RE:Ending Music
BigBear wrote:
"String literal is too large"
This means that the string you are trying to pass to Music.Play() is over the maximum allowable length of 255 characters. So why not just: