Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7771889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:45:31+00:00 2026-06-01T16:45:31+00:00

In an HTML5 game I’m making, I play a thud sound when things collide.

  • 0

In an HTML5 game I’m making, I play a “thud” sound when things collide. However, it is a bit unrealistic. No matter the velocity of the objects, they will always make the same, relatively loud “thud” sound. What I’d like to do is to have that sound’s loudness depend on velocity, but how do I do that? I only know how to play a sound.

playSound = function(id)
{
    sounds[id].play();
}

sounds is an array full of new Audio("url")‘s.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:45:32+00:00Added an answer on June 1, 2026 at 4:45 pm

    Use the audio element’s volume property. From W3:

    The element’s effective media volume is volume, interpreted relative
    to the range 0.0 to 1.0, with 0.0 being silent, and 1.0 being the
    loudest setting, values in between increasing in loudness. The range
    need not be linear. The loudest setting may be lower than the system’s
    loudest possible setting; for example the user could have set a
    maximum volume.

    Ex: sounds[id].volume=.5;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem: I'm making an HTML5 game and am attempting to make it faster
I am making a simple game in HTML5 canvas, it involves driving a little
I'm making a game using HTML5 canvas, How do I add a TextBox and
I'm making an HTML5 game. Is there anyway to provide the user with a
I'm making an export function to a HTML5 game of mine and my current
I'm improving the performance of a HTML5 Game,while I reset some arrays,in order to
I am trying to implement a lighting effect in an HTML5/JavaScript game using tile
I am developing an HTML5 canvas based mini-game and I can't seem to organize
Im using JavaScript, the HTML5 canvas-element and WebGL to make a simple 3D-game in
I have a game in HTML5 I wish to enclose inside a UIWebview. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.