Recently I discovered the webGL export of the Coppercube game engine editor doesn't support 3D Sound, so I took the challenge and wrote a mod. This demo shows a simple CC level with two test-sounds. You need to click the canvas once it runs.

This is basically just a test for various things: the sound engine, the fps mouse control and how/whether Coppercube works on itch.io.

NOTE: pity, the keyboard handler doesn't work, so you can't walk around. It works outside of itch.io.


Update, finally after 6 uploads and several hours I seem to have solved the keys mystery.

Keys seem to work now, and also to re-focus the canvas by a click.

Download the project ZIP from my mini3Dsoundengine project page.

Comments

Log in with itch.io to leave a comment.

(+1)

Do you mind sharing a simple CCB file on how this works? Would love to play with it - thanks - Great work!

Thank you! It's some time ago I did this, as far as I remember I ran it outside of coppercube, in parallel with the CC code. Only the camera position and angle was then transfered from inside CC to that script. So it used sounds that were not loaded in CC, but in that parallel 3d-sound script. However there may be several ways to integrate this into CC, for instance using the "do something every N seconds" behavior. (it's set to 200ms, but I'd rather suggest 100ms btw.)

So I'm sorry for not being able to provide you with an out-of-the-box CC integration, but once you have the actual JS sound handles of your loaded sounds in CC, it should be fairly easy. There's also the "run a script at startup once" behavior, where you most likely could place all the functions.

Here are the files of the demos:

https://jfkeo1010etc.itch.io/mini3dsoundenginejs

In any case, the browsers JS error console will give you most valuable info when something isn't working.

(+1)

Thank you so much. I will look into this as soon I find free time - let you know in case I end up using it in projects. All the best to you.

Ok, I think it's working now. One thing that still seems to make troubles is that grey bar, asking me to update some devlog. After I clicked it away by "dismiss", the keys worked again, after just AGAIN refusing to work. Very flipflop ish.

From what I read in the forum, I am supposed to put the event handler on the canvas, not the window. I tried that in a 1000 variations, did not work in FF and Edge. Same code works with window,self, body (via document.getElementById), but not with Canvas. Used the exact code found on stackoverslow, not working. After 6 hours of my lifetime trying to fix this bug, I am giving up. You know what? this iframe is my window handle. the parent page has no business to do in there. the iframe has it's own window handle, get your pranks off from it.

Hah! funny, it worked moments ago (as I just explained), but now not anymore. 

There is a keydow/keyup conflict with the iframe-surrounding page. By opening "More tools >Developer Tools > Elements > Event Handlers" and then manually removing the itch.io keydown and keyup handlers, I was able to make it work. From my POV this is a serious hurdle and I have no clue how other games circumvent this problem. It is in effect really frustrating. Also, the exact same handler works in jack airbourne, but not here.... Are they allowing / disallowing handler override individually?