Ooh that's nice. Good 'ol Indiegames the Weblog.
Miroslav, I'm glad you enjoyed the music. It seems dance music's not mentioned much on TIGsource, but that was my life for ten years... so it's hard to leave behind! I'm actually quite fond of the intro track, and might work some more on it (from a sample, I didn't even save any of the arrangements from this game.) Was also fun jamming on the faster bluesy track.
I'm really sorry some of you are having problems with the dancing. I'm using the only timer available to me in BlitzMax, Millisecs().
Here's the truly filthy sourcecode. Can you see anything I'm doing wrong, programmer people? The BPM for all songs is 160. Each song has 2x12 bars = 24 x 4beats/bar = 192 beats. They are 72 seconds long at this tempo, so that I calculate the length of a beat to be 72 / 192 = 375 milliseconds. I've hard-wired this figure into this code:
Local oscreenchange=screenchange
screenchange=True
Local starttime=MilliSecs()
SetChannelVolume musicchannel,1
Local beaten=False
Local lasttime=starttime
Local oldbeat=0
Local beatcount=0,obeatcount=0
Local rating#=0
Local rtext$=""
Local trail=0
starttime=MilliSecs()
player[0].mstate=ACUTSCENE
Repeat
Local timepassed=MilliSecs()-starttime
Local newbeat=timepassed / (375)
Local proximity=timepassed Mod (375)
If proximity>(375/2) proximity=375-proximity
beatcount=timepassed/375;
If beatcount<>obeatcount
g.anime=Null
g.play(Character(g).rocka1)
obeatcount=beatcount
EndIf
'Print"Beat!" ; 'Delay 1;
'beater=True
If (timepassed>lasttime+250)
beaten=False
EndIf
If Not beaten
If (lasttime<(beatcount-1)*375)
rtext="Miss!"
trail=0
EndIf
EndIf
If KeyHit(KEY_A) And beaten=False
player[0].anime=Null
If proximity<100
player[0].play(rock1)
Local thisrating#=Min((Float(100-proximity)/80.0 ),1.0)
rating:+thisrating
If thisrating>0.95
rtext="Perfect!"
ElseIf thisrating>0.75
rtext="awesome"
ElseIf thisrating>0.6
rtext="smokin'"
ElseIf thisrating>0.35
rtext="cool"
Else
rtext="weak"
EndIf
Else
player[0].play(rockfail1)
rtext="Fail!"
EndIf
beaten=True
lasttime=timepassed
If newbeat>oldbeat 'And beater=False
oldbeat=newbeat
beaten=False
EndIf
trail=0
EndIf
trail:+1
frames(True) ' update screen
bDrawText(String(((timepassed/375) Mod 4)+1),(player[0].x-screenoffset)-32,(player[0].y-screenyoffset)-(64*MULTI_PIXEL))
bDrawText(rtext,(g.x-screenoffset)-64,(g.y-screenyoffset)-((32+trail)*MULTI_PIXEL))
Flip(1)
Until (MilliSecs()-starttime>36000 )
Local thisrating#=(rating/Float(beatcount))
Besides this the only thing I can think of is Blitz' timers being inaccurate, or perhaps vsync being disabled on your machine (a problem with my framework basically.)
Anyway, we may never know. I guess some computers just don't want ya to be a Rockabilly.