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 lazer

I have a question about rhythm games with Impact - say for example I began to play a music track when the player presses Start, then triggers come up at certain points in the beat. Let's say it's a red square you have to click. What I was thinking about doing is this:

Measure how many seconds there are from the start of the song to the beat and use ig.Timer to trigger the red square spawning at that second.

However, I have not done much looking into things like how system lag affects timers and I have no idea if music has any potential to lag by any amount of time (though it would be preloaded). Before I flesh out this idea any further I'd like to see if anyone has done anything with rhythm mechanics in Impact and if there are any particular things I need to keep in mind to keep everything in sync (and most importantly if it's even possible)

EDIT: I just found another thread on rhythm games where Dom suggests syncing to ig.music.currentTrack.currentTime. However, the thread is from two years ago. Is this still a good way to go to get synchronized gameplay?

1 decade ago by SlouchCouch

I think ig.music.currentTrack.currentTime would work perfectly. just use it as a timer to fire off events at certain intervals.

There's also dancer.js at http://jsantell.github.com/dancer.js/ for beat detection at various frequencies. Once i'm done with my current game i'm 90% sure i'm going to do something with impact and dancer.

-dave

1 decade ago by SlouchCouch

also i just came across a shitty chrome bug with large sound files (over 3MB). here's a short read on it http://impactjs.com/forums/help/loader-hangs-when-loading-more-than-one-music-file-in-chrome.

tl;dr version: i had to make sure all my song files were under 2.5MB or else chrome would either have trouble loading the game, or would stop playing music completely after a while.

1 decade ago by lazer

I've had that bug in my games! Darn it. Thanks, at least now I know how to avoid it.

1 decade ago by TigerJ

That bug explains so much about my issues when I was streaming last Sunday.

1 decade ago by lazer

I thought about it and remembered when I encountered it earlier, and I actually saw it happening with sound files that were less than 3MB. I had a game that was generating all sounds dynamically using a plugin, so there were no sound files at all, and Chrome sound would still intermittently fail.
Page 1 of 1
« first « previous next › last »