
-----------------------------------
CreatedByGabe
Fri Jun 05, 2015 6:32 pm

HELP! I need to end a fork process for a long song!
-----------------------------------
Hi! I have a really big problem! I'm Making a game but the thing is that when I press "A" it need it to end the Process!
How do I end the fork process!
Here is my code, Take a look at it (I use turing 4.1 because 4.1.1 is not good at generating .exe's!)
[Code]
var mus : string
mus := "TitleScreenMusic.mid"
var flag : boolean := true
process TitleScreenMusicFork
    if flag then
        loop
            Music.PlayFile (mus)
        end loop
    else
        loop
            Music.PlayFileStop
        end loop
    end if
end TitleScreenMusicFork

%Put music processes ABOVE! --------------------------------------------

put "Music %100 Loaded!"
delay (1000)
cls
Pic.Draw (mypic, maxx div 5, maxy div 5, 0)
fork TitleScreenMusicFork

getch (input)
if input = "a" or input = "A" then
    flag := false
    %fork TitleScreenMusicFork
    cls
    Music.PlayFile ("RealDing.wav")
end if
%Finish TILTLE SCREEN!
[/Code]

-----------------------------------
Zren
Fri Jun 05, 2015 6:46 pm

RE:HELP! I need to end a fork process for a long song!
-----------------------------------
There's an example of an interuptable looping song in the documentation for [tdoc]Music.PlayFileStop[/tdoc]

Edit: You could also use [tdoc]Music.PlayFileLoop[/tdoc] instead of doing the looping/forking yourself.

-----------------------------------
CreatedByGabe
Fri Jun 05, 2015 6:54 pm

RE:HELP! I need to end a fork process for a long song!
-----------------------------------
There's an example of an interuptable looping song in the documentation for 

Thank you but I already found the soultion!
instead of
[Code]
loop
Music.PlayFile
end loop
[/Code]

You put
[Code]
Music.PlayFileLoop
[/Code]

Putting Music.PlayFileLoop would help because you can do
[Code]
Music.PlayFileOff
[/Code]

to stop it!

Thanks Though But I already fixed the problem!
