User blog:Monovae/go dance mechanics/physics/math

alright, here comes some math. when I was designing my go dance game in the two and a half days of rushing around programming, I needed to come up with a way to get arrows to move across the screen. and, as always, there was only one way to do it: math. I first started with the rate to spit out arrows. my first songs were both at 100 beats/min, and so I needed to find some way to spit them out at 100 a minute. so, in order to find the frequency of the notes(Hz{units/second}), you need to take the beats/min divided by the time, but I needed the period, which is the inverse of frequency, in other words, time/beats/min. so the amount of time that one beat takes up at 100 beats/min is 60/100 which is .6 seconds. but that doesn't do me any good.so I need to multiply by 60, which is the frames a second, so I get 3600/100, which is 36, so I just need to have a variable that counts up to 36 and resets itself. this can be done for any tempo as long as the tempo is in the denominator. so now how do I get it moving across the screen? well, I need to move 200 sprite distance in 4 beats, so 50 in one beat. so now I need to take 50/time for a beat and then voila, it gives me a correct distance and speed. so I just need to set a new variable to the beat time and use that during my calculations. it's good to use math isn't it?