I
I
Ivan Pavlov2016-09-24 19:00:16
Java
Ivan Pavlov, 2016-09-24 19:00:16

Is it possible to manually update com.badlogic.gdx.utils.Timer?

Hello! When working with Timer from LibGDX, it became necessary to manually update the timer. The use of stop and start is not considered since it is easier to determine when the timer should run than when to stop and start. The use for these purposes of structures in the form

if (isRun)
{
  var += some_const;
  if (some_const > max_var)
   isRun = false;
}

it is inconvenient that there are four such timers and this makes the code cumbersome.
The com.badlogic.gdx.utils.Timer class has a local update method, but it is not available for use for obvious reasons. Maybe in some way you can get the opportunity to manually update the Timer? Can eat other implementations of timers? Has no one else had such a need that even the Internet does not give an answer to this question?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2016-09-24
@iPaf

Encapsulate your construct in a class and create four instances - and there will be no bulkiness.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question