Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
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.
Tagged:
+1 -1 (+3 / -0 ) Share on Facebook
Sign In or Register to comment.