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...

P#41900 2017-06-23 20:37 ( Edited 2017-06-24 02:13)

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

a=max(a-1,0)
P#41904 2017-06-23 22:13 ( Edited 2017-06-24 02:13)

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-11-22 07:29 | 0.008s | 2097k | Q:11