Log In  

Hi everyone!

I am building a small pong clone and I would like the game to pause for 2 or 3 seconds whenever a player is scoring.

I saw that there are out there timer class but, since it was not easy for me to implement that, I wanted to ask if there is a simpler way to achieve this result.


P#38676 2017-03-24 09:06 ( Edited 2017-03-24 23:17)

SOME_LIMIT=60 -- 30 = 1 second with _update() running at 30FPS.
function _update()
 if timer>=SOME_LIMIT and not is_happening then
  -- After two seconds, do something.
P#38677 2017-03-24 09:42 ( Edited 2017-03-24 13:52)

Is this the sort of thing you were looking for in your other thread too?

P#38693 2017-03-24 15:38 ( Edited 2017-03-24 19:38)
:: ltpitt

Not really (I would like to use this solution to give the players a few seconds of pause after scoring, before starting the game again) but...
It could clearly work even there!

Tomorrow I'll try to implement it and let you know :)

P#38697 2017-03-24 19:17 ( Edited 2017-03-24 23:17)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-04-10 03:56 | 0.009s | 4194k | Q:15