Add some stubby stubs
This commit is contained in:
parent
ecc087289b
commit
7a0f64c30b
5
docs/assets/js/sounds/soundassetmap.js
Normal file
5
docs/assets/js/sounds/soundassetmap.js
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
// A mapping of asset names to their files
|
||||
let soundAssets = {
|
||||
|
||||
}
|
27
docs/assets/js/sounds/soundcontext.js
Normal file
27
docs/assets/js/sounds/soundcontext.js
Normal 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();
|
13
docs/assets/js/sounds/sounds.js
Normal file
13
docs/assets/js/sounds/sounds.js
Normal 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) {
|
||||
|
||||
}
|
28
docs/assets/js/sounds/soundsnippet.js
Normal file
28
docs/assets/js/sounds/soundsnippet.js
Normal 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() {
|
||||
|
||||
}
|
||||
}
|
@ -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>
|
||||
|
Reference in New Issue
Block a user