Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
You learn something new everyday! — Gideros Forum

You learn something new everyday!

Just figured you can do something like this in Lua !
function still()
	print("still")
end
 
function move()
	print("move")
end
 
stuck=true
(stuck and still or move)()
So still will be executed if stuck is true, otherwise move will be executed. No idea if it's faster then if this then that else the other, but it may be.
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
Tagged:
+1 -1 (+4 / -0 )Share on Facebook
Sign In or Register to comment.