Skip to content

Instantly share code, notes, and snippets.

@Bradshaw
Forked from hugodes/gist:6489552
Last active December 22, 2015 14:59
Show Gist options
  • Save Bradshaw/6489560 to your computer and use it in GitHub Desktop.
Save Bradshaw/6489560 to your computer and use it in GitHub Desktop.
-- Files are like functions in lua, except they're only meant to be calles once so you're better off doing what I suggested in my gist
local health = 100 -- This is local to the whole file
-- class wasn't useful
function getHealth()
return health -- This returns the value, so health is closed to the file, but can be "read" with this function
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment