Game logic in scripting language vs. internal engine : r/gamedev
Lua uses standard mathematical symbols for comparison, with one notable exception for "not equal". == (equal to) ~= (not equal to) < , > , <= , >= (less/greater than comparisons) 3. Combining Logic logic.lua
: Since Lua lacks a native ternary operator (like condition ? a : b ), it uses the idiom (condition and a) or b . Typical logic.lua Structure Game logic in scripting language vs
: The operators and and or use short-circuit evaluation. it returns the second.
or returns the first argument if it is truthy; otherwise, it returns the second.
and returns the first argument if it is falsy; otherwise, it returns the second.