Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Stopping a Sound?
Old
ShadowGlove84
Junior Member
 
Status: Offline
Posts: 3
Join Date: Jan 2012
Question Stopping a Sound? - 01-19-2012, 09:00 AM

I have a BG music playing in a game world for school. The BG is long enough so that it'll go on forever, but I want it to stop when the game is done to make way for a victory theme. How would I make the first sound stop so the second on can be heard?

-ShadowGlove84
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 01-19-2012, 09:15 AM

First thing is to have a "while something is true" event. In that event, in the "while" section, add a method and call that method "MainMusic." In that method add your music in a infinite loop. Now, make a number variable of 1 and 0. In the logic of the event, make it "If (MainMusic) == 1" then it will do your event. Until that variable is 1, it will not play the music. To switch to victory music, make another method but call it "VictoryMusic" and make another even identical to the first except, make the number check for "== 2" so when the game is over, you can assign the variable the number 2 and have it play the second song, becuase the frist song will stop once the variable is changed. If you have no other songs besides those 2, then you can just have the variable set to 0 and have the second song play normally by dragging the function from the methods list on the left. Hope this helps!


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
ShadowGlove84
Junior Member
 
Status: Offline
Posts: 3
Join Date: Jan 2012
Default 01-19-2012, 09:24 AM

Where do I make the number variable?
   
Reply With Quote
Old
ShadowGlove84
Junior Member
 
Status: Offline
Posts: 3
Join Date: Jan 2012
Default 01-19-2012, 09:31 AM

Never mind ir works. Thanks a million!
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 01-19-2012, 11:38 AM

No Problem!


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.