0
\$\begingroup\$

I started with game programming couple of weeks back. For the starters I tried to develop ZigZag (link takes you to 2 min gameplay).

I am done with the logic of gameplay by now. It runs well and all. Now I want to speed up the gameplay as user passes some score. Say after 100 points increase the speed of the ball.

I have two options:

  1. Control the speed using time-delay by varying time.delay(var).
  2. Actually increasing the speed of the moving ball

Not sure which one is a good idea in long term, I'm looking for help from experienced game developers.

You can checkout the source code: https://github.com/ravi-ojha/zigway/blob/master/zigway.py

\$\endgroup\$
  • \$\begingroup\$ Which to choose depends on your game. If your game has animations that rely on the global delta-time between frames, it would probably be best to only speed up the elements that need to be sped up (which in your case is the ball). Keep those concerns separate. \$\endgroup\$ – Anko Mar 5 '15 at 10:32
0
\$\begingroup\$

Time delays are usually not a good idea because you can't go below zero. Also keep in mind that differently powerful systems will take shorter or longer to execute your actual game-loop without the artificial delay. When you want the game experience to be independent from the power of the users hardware, get a time measurement at the beginning of your game-loop, run the loop and then pause by the time which is still left.

But the better solution would likely be to increase the movement speed of all game objects. In that case you can go as high as you want, no matter how powerful the users hardware is.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.