Repository navigation
Play the sound and the music of the game on the play page - #25
Open
beetlebugorg wants to merge 1 commit into
Open
beetlebugorg wants to merge 1 commit into
beetlebugorg wants to merge 1 commit into
Conversation
The game names its sounds in app(sfx) and its song in app(music), and the page must play them. The play page had no player, so the game was silent. The page now reads the two values in each frame and plays them with sound.js, a copy of toysound.js of ztk. Two buttons turn the sound and the music on, as a browser starts audio only after a gesture.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The game on https://beetlebug.org/lamplighter/play/ had no sound. The game only names its sounds in
app(sfx)and its song inapp(music); the page must play them, astoys.jsdoes on the toy page of ztk. The play page had no player.docs/site/play/sound.js: a copy ofdocs/site/toysound.jsof ztk (BSD-2-Clause, with its header). It has an effect for each name that the game uses and the two songslamplighter-titleandlamplighter-play.docs/site/play/index.html: in each frame the page reads and clearsapp(sfx)and readsapp(music). Two buttons, Sound and Music, turn each one on. A browser starts audio only after a gesture, so both start off; the choice stays inlocalStorage, and a saved choice starts at the first tap or key. The sound stops while the tab is hidden.tools/site.tclcopiessound.js.tests/web/sound.mjs: a check in headless Chromium.Ran: the site build with ztcl beta.8, the game files of the live site, and
tests/web/sound.mjsin Chromium: the Sound button makes one AudioContext,jump landstarts 2 voices and clearsapp(sfx), and the title music starts more. Not run: a real speaker, a phone, or Safari.