Hi, i was gonna create a sort of osu mania game on my webapp. Currently the webapp is for composing music, and had the idea to connect the composed song to a beatmap. I was gonna start development one of those days but i wanted to get inspiration by osu and how the game handles beatmap creation and also the actual game inner workings.
My biggest concern is doing the animation and hit calculation, what i was thinking is to have a game loop which runs at every frame, and in this game loop the current timestamp is slowly increased. At every tick i check if there are any notes which have timestamp within, idk, 1 second from the current one, if it is, i remove them from the song notes and add them to the actual game. At every tick i also check the current position of the note by calculating the height based off how distant the note timestamp is from the current timestamp.
Once the player hits a key, it checks if there are any notes in the currently visible notes which are within, idk, 50ms from the end, and from that calculate if it was a correct note press or not.
I wondered if there is someone that could explain to me how osu manages the playback of the song, so that i can try to make it as best as i can. Thanks!
My biggest concern is doing the animation and hit calculation, what i was thinking is to have a game loop which runs at every frame, and in this game loop the current timestamp is slowly increased. At every tick i check if there are any notes which have timestamp within, idk, 1 second from the current one, if it is, i remove them from the song notes and add them to the actual game. At every tick i also check the current position of the note by calculating the height based off how distant the note timestamp is from the current timestamp.
Once the player hits a key, it checks if there are any notes in the currently visible notes which are within, idk, 50ms from the end, and from that calculate if it was a correct note press or not.
I wondered if there is someone that could explain to me how osu manages the playback of the song, so that i can try to make it as best as i can. Thanks!