Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

71
Views
Mute button for a CanvasGame in Javascript

I'am trying (without luck) to implement a function to mute/unmute all the sounds in my JavaScript file. Is a simple Pacman game, so the sounds could be a little anoying.

JavaScript:

this.pacmanRotation = this.Rotation.right;
this.wakaSound = new Audio("sounds/waka.wav");


this.powerDotSound = new Audio("sounds/power_Dot.wav");
this.powerDotSoundActive = false;
this.powerDotAboutToExpire = false;
this.timers = [];

this.eatGhostSound = new Audio("sounds/eat_ghost.wav");

this.madeFirstMove = false;

Html:

<button type="submit" class="neon">
    <strong> <i class="fas fa-volume-down"></i> &nbsp; Sound</strong>
  </button>

Html reference to canvas:

<div>
  <canvas id="gameCanvas"></canvas>
</div>

I know how to do this with Audio/Video html tag, but here a could not make it work!

Any thoughts to how can i make this??

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!