Log In  


I'm doing this a lot through my games in loops and I feel like there should be a shorthand for it...?

a-=1
if a<=0 then a=0 end

And similar type of counting, etc...



What you want is min() or max(). Sum'n like

a=max(a-1,0)


[Please log in to post a comment]