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.

Dark GDK / Sounds

Author
Message
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 6th May 2008 07:21
Hey all,

I'm trying to build a Simple First-person shooter and I need to know how I can get a sound to play when I press a Key, can someone give me a code example. All I want to do is play a noise when I press a key, I know something like this would have to placed in the loop of the program. So yeah I just need a simple code example.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 6th May 2008 07:24
Maybe the dbPlaySound command might be of some help...
If you didn't know, there is a help file with all DGDK commands documented and listed @ Start Menu\Programs\The Game Creators\Dark GDK\Documentation\Information ...

Code sample? Here is something overly simple...


~~It's not who you are underneath, but what you do that defines you.~~
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 6th May 2008 07:31
Thats cool and all, but the sound keeps looping. How do i change that.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 6th May 2008 07:36
Check if the sound is playing and if it not then go ahead and play the sound the again...



~~It's not who you are underneath, but what you do that defines you.~~
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 6th May 2008 07:44
This works thanks!
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 6th May 2008 08:03
No Problem... I find it sort of funny I was asking myself the same question as you were asking me only like two hours ago...

~~It's not who you are underneath, but what you do that defines you.~~

Login to post a reply

Server time is: 2024-11-20 09:15:28
Your offset time is: 2024-11-20 09:15:28