alpha icon indicating copy to clipboard operation
alpha copied to clipboard

Timer : Luxe.timer.reset() make physics not works

Open Blist opened this issue 8 years ago • 2 comments

The workflow of Luxe.timer.reset() maybe need to be review because when you do Luxe.timer.reset() all timer is reset, and game physics down because of this line :

https://github.com/underscorediscovery/luxe/blob/master/luxe/Physics.hx#L73

maybe an argument on Luxe.timer.reset(function) who function represent the function set on timer.schedule(time, function) that permit to reset specific timer?

Blist avatar Mar 25 '16 17:03 Blist

One thing you can do is store the timer returned from a function like schedule() - it returns a snow.api.Timer which does have a stop() function. (It would be nice to have a stop/pause/cancel on a luxe.Timer, though - agreed.)

jtruher avatar Mar 25 '16 18:03 jtruher

Thanks for the report, that's a valid issue and you're both correct, the timer needs more control on it's instance and the reset call was shortsighted as an API. @Blist can you describe what you were trying to do, i.e your intent, so I can better understand why you were using this function in particular?

ruby0x1 avatar Jul 15 '16 00:07 ruby0x1