1 | var _bpf = bpm / 60 / game_get_speed(gamespeed_fps); |
2 | var _spb = 1 / (bpm / 60); |
3 | if (snd_is_playing(global.currentsong[1]) && inSync == true) |
4 | { |
5 | beat = audio_sound_get_track_position(global.currentsong[1]) / _spb; |
6 | beat = frac(beat); |
7 | } |
8 | else |
9 | { |
10 | inSync = false; |
11 | beat += _bpf; |
12 | if (beat >= 1) |
13 | beat -= 1; |
14 | } |
15 | image_index = beat * (image_number * loopsPerBeat); |