Add some stubby stubs

This commit is contained in:
Evan Pratten 2020-04-17 22:41:08 -04:00
parent ecc087289b
commit 7a0f64c30b
No known key found for this signature in database
GPG Key ID: 93AC7B3D071356D3
5 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,5 @@
// A mapping of asset names to their files
let soundAssets = {
}

View File

@ -0,0 +1,27 @@
class SoundChannel{
/**
* Create a sound channel
* @param {number} max_queue_size Maximum number of sounds that can be queued before sounds are skipped
*/
constructor(max_queue_size) {
this.max_size = max_queue_size
}
}
class SoundContext{
constructor() {
// Define all sound channels
this.channels = {
bgm: new SoundChannel(2)
}
}
}
// The global context for sounds
let globalSoundContext = new SoundContext();

View File

@ -0,0 +1,13 @@
// All available sounds
let sounds = {
}
/**
* Cache all sounds in browser, then notify a callback of success
* @param {function} callback Callback for completion
*/
function preCacheSounds(callback) {
}

View File

@ -0,0 +1,28 @@
class SoundSnippet{
/**
* Load a sound asset to a snipper
* @param {string} asset_name Asset name as defined in soundassetmap.js
*/
constructor(asset_name) {
}
/**
* Cache this sound, then notify a callback of completion
* @param {function} callback callback to notify
*/
cache(callback) {
}
play() {
}
stop() {
}
}

View File

@ -32,6 +32,14 @@
<script src="assets/js/injection/cssinjector.js"></script>
<script src="assets/js/preloader/preloader.js"></script>
<!-- Sounds -->
<script src="assets/js/sounds/soundsnippet.js"></script>
<script src="assets/js/sounds/soundassetmap.js"></script>
<script src="assets/js/sounds/sounds.js"></script>
<script src="assets/js/sounds/soundcontext.js"></script>
<!-- Game -->
<script src="assets/js/index.js"></script>
</body>