2D football game
in
Programming Questions
•
2 years ago
Hello together
I'm writing a 2D football game and I've a question about redrawing. At the moment the pc draws the hole screen new with each time he goes through the void draw(). The problem is that he doesn't need any time the same time and so the players don't have the same speed all the time. And I changed the code only a little bit one time and then he needed only about half the time for one draw then bevor. But my code is only about 500 lines long and I don't understand why that little change of code can make such a big difference in the speed of the pc. Because my pc is not 50 years old and he can play the newest games without a problem but with my little programm he seems to have one :-) Do you know why this is? Can I avoid this with including the time or what? And is there a possibility to move the players without redrawing the hole screen all the time?
Kind regards
Nick
I'm writing a 2D football game and I've a question about redrawing. At the moment the pc draws the hole screen new with each time he goes through the void draw(). The problem is that he doesn't need any time the same time and so the players don't have the same speed all the time. And I changed the code only a little bit one time and then he needed only about half the time for one draw then bevor. But my code is only about 500 lines long and I don't understand why that little change of code can make such a big difference in the speed of the pc. Because my pc is not 50 years old and he can play the newest games without a problem but with my little programm he seems to have one :-) Do you know why this is? Can I avoid this with including the time or what? And is there a possibility to move the players without redrawing the hole screen all the time?
Kind regards
Nick
1