Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by samowitsch

the right way? In my little project i used buzz.js for audio and hammer.js for touch handling. Both don't work in Ejecta for different reasons (e.g. DOM manipulation).

Two short examples for touch and audio would be very helpful.
Can it programmed the html5 way or are there Ejecta specials?

Regards
samowitsch

1 decade ago by samowitsch

It's all in the API, sorry. I give it a try.

Regards
samowitsch

1 decade ago by samowitsch

Ejecta makes more fun every day ;o)
Now some code examples for audio:

//sfx loop
var sfx = document.createElement('audio');
sfx.src = 'media/sfx/serious.mp3'
sfx.preload = true
sfx.loop = true
sfx.load()
document.body.appendChild(sfx);
sfx.play()

//sfx
var shoot = document.createElement('audio');
shoot.src = 'media/sfx/laser.mp3'
shoot.preload = true
shoot.loop = false
shoot.load()
document.body.appendChild(shoot);

//somewhere else in the code
shoot.play()

1 decade ago by samowitsch

And here some testings with touch handling:

//touch
document.addEventListener('touchstart', function(ev) {
                          mousex = ev.touches[0].pageX;
                          mousey = ev.touches[0].pageY;
                          mousedown = true
                          clicked()
                          console.log([mousex,mousey,mousedown])
                          }, false);
document.addEventListener('touchstop', function(ev) {
                          mousex = ev.touches[0].pageX;
                          mousey = ev.touches[0].pageY;
                          mousedown = false
                          console.log([mousex,mousey,mousedown])
                          }, false);
document.addEventListener('touchmove', function(ev) {
                          mousex = ev.touches[0].pageX;
                          mousey = ev.touches[0].pageY;
                          mousedown = false
                          console.log([mousex,mousey])
                          }, false);

1 decade ago by paulh

just what i was looking for, thx
Page 1 of 1
« first « previous next › last »