Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Issues with background music and looping
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
butler




PostPosted: Wed Dec 18, 2013 10:25 am   Post subject: Issues with background music and looping

What is it you are trying to achieve?
make a math quiz/test that has music playing in background and eventually add graphics


What is the problem you are having?
music wont play in background and issues with the loops when you get a question wrong and if you finish the test the loop has problems with not stopping


Describe what you have tried to solve this problem
tried looking on the forums and tried to change the format of the loops used in the code




Turing:


%MATH QUIZ PROGRAM
%Make music play in background instead of just as you start running program
Music.Play ("2<e>gb>e<bg<e>gb>e<bg<e>gb>e<bg<e>gb>e<b>b1b2b4be1e2b>2c<8b>4c<b2ab4ag2e1e")

Music.Play ("2<ab>1c>4cecec2c<c1d4>e4aef+<bb2>1e>2gb>1e2<<<<<e>gb>e<bg<e>gb>e<bg<e>gb>e<bg<e>gb>e<bg")

Music.Play ("<1e>4eb>e1g2<d>4f+d<2ac4>ec<2g<1e>4eb>e1g2<d>4f+d<2ac4>ec<2g<1e>4eb>e1g2<d>4f+d<2ac4>ec<1g2df+g>1d+")

Music.Play ("2<<e>gb>e<bg<e>gb>e<bg<e>gb>e<bg")


put"If you fail a question you need to redo the last answer. "
put"What is 5x11? "
var num:real
const numans:=55
loop
   get num
   if num=55 
   then put"Good job "
   loop
      put"What is the Square root of 64? "..
      var sqrt64:real
      get sqrt64
      if sqrt64=8
      then put"WOW great work! "
      loop
         put"What is 2x43 to the power of 2? "
         var ques1:real
         get ques1
         if ques1=3698
         then put"Awesxome work, the final question is next "
         loop
            put"This is the final question. 2(35x2)**2/4 ? "
            var ques2:real
            get ques2
            if ques2=2450
            then put"CONGRATULATIONS you beat the test :D "
            loop
               put"You have beat the test good job :) "
               end loop
            else
            put"What matters is that you tried "
            exit
            end if
            end loop
         else
         put"You came pretty close "
         exit
         end if
         end loop
      else
      put"Nice try ;) "
      exit
      end if
      end loop
   else
   put"FAILURE"
   exit
   end if
end loop



Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: Wed Dec 18, 2013 1:48 pm   Post subject: RE:Issues with background music and looping

That's because music.play doesn't run in the background, it only runs when you call it. You could use actual music, that would play in the background
Dreadnought




PostPosted: Wed Dec 18, 2013 4:17 pm   Post subject: Re: Issues with background music and looping

To play music in the background (either music that you create or a music file) you need to fork a separate process that plays the music while your game runs. You can think of each process as a separate program while it runs.
This is exactly what Music.PlayFileReturn and other similar functions do to play music in the background.
Raknarg




PostPosted: Wed Dec 18, 2013 4:34 pm   Post subject: RE:Issues with background music and looping

Not true, actually. You can play music without it being in a process. I used to do it when I used Turing.
Dreadnought




PostPosted: Wed Dec 18, 2013 5:03 pm   Post subject: Re: Issues with background music and looping

Raknarg wrote:

Not true, actually. You can play music without it being in a process. I used to do it when I used Turing.

There is a process either in your code or in the Turing source code (found under "Turing 4.X -> predefs").
Raknarg




PostPosted: Wed Dec 18, 2013 5:54 pm   Post subject: RE:Issues with background music and looping

Oh. Well nevermind then.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: