@Jacko Enterframe event and os.timer() within an if condition, where you check the current os.timer against a previously taken os.timer value. if the difference between those is> 1000, a second should ve passed. You could also use timer with infinte loop and act on event.timer if your problem is that you have too many timers around
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@Jacko Sorry, I thought you would guess it was supposed to be in the main enterframe event...
function myEnterFrame(event)if event.frameCount%application:getFps()==0thenprint("blah")-- Here stuff will be execute once every secondend-- Here you can do more stuff that needs to be execute every frame!end
stage:addEventListener(Event.ENTER_FRAME,myEnterFrame)
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
You could also use timer with infinte loop and act on event.timer if your problem is that you have too many timers around
Likes: pie
https://deluxepixel.com
@Jacko , I think it should be like this
Likes: SinisterSoft
https://deluxepixel.com
Likes: SinisterSoft