Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / menu & sounds

Author
Message
VaderJ
21
Years of Service
User Offline
Joined: 20th Oct 2003
Location:
Posted: 2nd Apr 2004 09:51
I have a main menu for the game I am making. So far everything is working as planned. Everything except one thing. I am using sprites for my menu options and I want it so that whenever the cursor moves over one of the sprites a clicking sound is made. I've got it so that it plays the sound. My problem is that the sound repeats continuously very fast especially if the cursor is left over the sprite. I want it so that even if you left the cursor over the sprite the sound would stop until I moved it over another sprite or away from and to that same sprite again. I have tried using the wait and sleep commands, but it puts too much of a pause in the loop and it isn't good. I have also tried stopping and then restarting the soud, but that didn't work either. Anyone know any techniques good for this or any theories?? Any help would be much appreciated. Thanks.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 2nd Apr 2004 11:37 Edited at: 2nd Apr 2004 11:40
You would need to check to see what sprite the pointer was previously over and the current one. If the two dont compare then play the sound and make the previous one the same as the current one. Something along the lines of :




The place for all great plug-ins.
Keeping it Unreal since 2004
Morloc
21
Years of Service
User Offline
Joined: 21st Mar 2004
Location: UK
Posted: 4th Apr 2004 00:39
Aye I would use a temp variable field ie
flag=1
if cursor over sprite and flag = 1 then play sound : flag = 0 ofcourse after it goes over another sprite toy will need to make flag = 1 again.

after it plays once it wont again as flag is now 0.

I'll leave you to work out the actual code.

hope that helps

Morloc

Login to post a reply

Server time is: 2025-05-24 08:24:09
Your offset time is: 2025-05-24 08:24:09