Alice Community  

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

Reply
 
Thread Tools Display Modes
how do u make an event that will stop doing something
Old
mslvr40
Member
 
Status: Offline
Posts: 16
Join Date: Nov 2011
Default how do u make an event that will stop doing something - 11-28-2011, 05:39 PM

Hi for my racing game i want their to be a radio. I have it so if you press 2 then the song will switch. but the first song is still playing. how do i get the song to stop. please look at my world

im sorry this link is bad. i will put up a new 1
Attached Files
File Type: a2w radio.a2w (159.8 KB, 6 views)

Last edited by mslvr40; 11-28-2011 at 05:41 PM.
   
Reply With Quote
Old
mslvr40
Member
 
Status: Offline
Posts: 16
Join Date: Nov 2011
Default 11-28-2011, 05:55 PM

here is the new link
   
Reply With Quote
Old
mslvr40
Member
 
Status: Offline
Posts: 16
Join Date: Nov 2011
Default 11-28-2011, 05:58 PM

it says i cant upload it because a security token is missing. i dont know what that means. whatever can u just tell me how to it or post a pic or a world with an example. something like: if a key is pressed then object will stop doing something
   
Reply With Quote
Old
davidghemer
Member
 
Status: Offline
Posts: 38
Join Date: Nov 2011
Default 11-29-2011, 12:34 AM

Use a boolean valued variable (true or false) which you set to true when you want the music on and false when you want the music off. The you could use a "when something is true" event to only play the music when your variable is true.


For video tutorials on programming in Alice 2.2 check out my YouTube channel

http://www.youtube.com/user/drdave785

Also check out my Programming in Alice blog at

http://programminginalice.com
   
Reply With Quote
Old
davidghemer
Member
 
Status: Offline
Posts: 38
Join Date: Nov 2011
Default 11-29-2011, 12:50 AM

Attached is a simple example that shows you how to use events and a boolean valued variable to turn the music on and off. (Sorry about the choice of sounds - it gets annoying very quickly)


You'll need to vary it slightly so that you will also switch to the other song. (perhaps use two boolean valued variables).
Attached Files
File Type: a2w birdsong.a2w (646.9 KB, 51 views)


For video tutorials on programming in Alice 2.2 check out my YouTube channel

http://www.youtube.com/user/drdave785

Also check out my Programming in Alice blog at

http://programminginalice.com
   
Reply With Quote
Old
mslvr40
Member
 
Status: Offline
Posts: 16
Join Date: Nov 2011
Default 11-30-2011, 04:36 PM

Quote:
Originally Posted by davidghemer View Post
Attached is a simple example that shows you how to use events and a boolean valued variable to turn the music on and off. (Sorry about the choice of sounds - it gets annoying very quickly)


You'll need to vary it slightly so that you will also switch to the other song. (perhaps use two boolean valued variables).
Thanks alot
   
Reply With Quote
Reply

Thread Tools
Display Modes

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.