Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   how do u make an event that will stop doing something (http://www.alice.org/community/showthread.php?t=7676)

mslvr40 11-28-2011 06:39 PM

how do u make an event that will stop doing something
 
1 Attachment(s)
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

mslvr40 11-28-2011 06:55 PM

here is the new link

mslvr40 11-28-2011 06: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

davidghemer 11-29-2011 01: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.

davidghemer 11-29-2011 01:50 AM

1 Attachment(s)
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).

mslvr40 11-30-2011 05:36 PM

[QUOTE=davidghemer;43980]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).[/QUOTE]

Thanks alot


All times are GMT -5. The time now is 05:26 PM.

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