Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Sound of a car while accelerate

andgameplay
Registered User
Quote
2021-09-28 13:43:34

Hi! I'm wanting to create the car sound while accelerating with the button of keyboard, however, the sound has a loop repeating endlessly, getting really ugly, it's probably because the accelerator key comand is being pressed, which is the same command as "action execute a sound". How do I make the car sound play only once while accelerating the car? It is possible to do without javascript code? Thank you!


andgameplay
Registered User
Quote
2021-10-15 13:28:06

Hello devs! So my question is: how do you play a sound and have it play in its entirety once, even if the player keeps pressing the command key, like when accelerating a car?


VP
Guest
Quote
2021-10-15 16:01:38

It's because windows repeats keypresses which is triggering multiple sounds.

To prevent that, either turn off key-repeat in your windows settings or use variable in coppercube.

EG:

When key is pressed, if variable "EngineSND" <>1, Play "engine.wav" looped.
Set Variable "EngineSND" =1

When key is released, Stop Sound "engine.wav".
Set Variable "EngineSND" =0


andgameplay
Registered User
Quote
2021-10-25 14:02:08

Thanks! It's a good idea!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact