XD005
Member
Hello everyone, its been a while since I have made a serious game in GMS.
Anyway, I am currently working on a music game and I just need help with this timing script.
Instead of millisecond values, I am using tick values.A tick is just a unit derived from the BPM.
One tick is equal to BPM / 192. I have an equation I am using to create an object at a certain speed when it is appropriate.
This is the script I was using for millisecond values in an earlier build.
And then it would use the millisecond value of the song currently and compare that with the results of that but I want to use tick values instead. To get the current time in ticks, you can use this script.
//Get the current tick value
global.tick=((60/global.BPM)/global.tick_resolution)
global.tick=(global.song_position-global.offset) / global.tick;
Disregard the offset, that is for songs that don't start at 0 seconds. I would be so grateful for assistance in this matter.
Anyway, I am currently working on a music game and I just need help with this timing script.
Instead of millisecond values, I am using tick values.A tick is just a unit derived from the BPM.
One tick is equal to BPM / 192. I have an equation I am using to create an object at a certain speed when it is appropriate.
This is the script I was using for millisecond values in an earlier build.
Code:
//Process the node creation
x1 = receptor_x + receptor_width/2 //the position the note is created
x2 = receptor_x + receptor_width_padding + receptor_width_center // the position of the target (say, 320)
sp = global.gem_speed; // speed of the note (say, 1)
t1 = global.NoteTimes[index] //the time that the note is created (global.note_times[global.current_note] in this case)
t2 = 0 //the time the note reaches to the target
t3 = 1000/room_speed; //This is the unit, converts the pixels to ticks
t2=((x2-x1)/sp*t3)/1000;
//Get the current tick value
global.tick=((60/global.BPM)/global.tick_resolution)
global.tick=(global.song_position-global.offset) / global.tick;
Disregard the offset, that is for songs that don't start at 0 seconds. I would be so grateful for assistance in this matter.