click a button, sound made
Author |
Message |
white_dragon
|
Posted: Sat May 15, 2004 4:32 pm Post subject: click a button, sound made |
|
|
this one should be easy but i can't figure it out.
how do u make it so then when someone clicks a button, it makes a sound. at the same time, they hafta wait a few seconds before they can fire again. something like a reload time. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
guruguru
![](http://www.vialattea.net/esperti/immagini/einstein.gif)
|
Posted: Sat May 15, 2004 4:48 pm Post subject: (No subject) |
|
|
code: |
var x, y, b : int
loop
Mouse.Where (x, y, b)
if b = 1 then
play ("abcdefgabcd")
delay(1000)
end if
end loop
|
|
|
|
|
|
![](images/spacer.gif) |
white_dragon
|
Posted: Sun May 16, 2004 4:58 pm Post subject: (No subject) |
|
|
tks. about the reload time............... after they click a button, can i make it so they hafta wait before they can click again? |
|
|
|
|
![](images/spacer.gif) |
SuperGenius
|
Posted: Sun May 16, 2004 5:58 pm Post subject: (No subject) |
|
|
That is already the case for that code because while the computer is waiting for the delay it will not recognize clicks. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun May 16, 2004 6:06 pm Post subject: (No subject) |
|
|
umm... no... cuz delay would pause the program itself. To emplement cooldown, you take system's time and save it in a variable. The user then cannot fire untill systemTime > (fireTime + cooldownTime) is satisfied. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
SuperGenius
|
Posted: Mon May 17, 2004 3:58 pm Post subject: (No subject) |
|
|
I was assuming that this code would be run in it's own process in a loop. |
|
|
|
|
![](images/spacer.gif) |
|
|