![]() ![]() Step = delta_t / 1000 # / 1000 because unit of velocity is seconds Get the time between to frames ( delta_t) and scale the movement of the snake by the elapsed time ( delta_t / 1000): class Game: self.velocity = 400 means 400 pixel per second). Define the distance, of movement of the snake per second (e.g. ![]() ![]() Use the return value to control the speed. The return value of () is the time which has passed since the last call. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |