04-04-2010, 12:35 PM
only use radians instead of degrees. If you want the user to be able to use degrees, write a setter and a getter that converts it.
Im not sure how optimized the cos() and sin() functions are in ruby. It might be faster if you calc the values of the cos() and sin() when the game starts, and cache it into a table, so that you don't have to calc it every frame update.
Im not sure how optimized the cos() and sin() functions are in ruby. It might be faster if you calc the values of the cos() and sin() when the game starts, and cache it into a table, so that you don't have to calc it every frame update.