Difference between revisions of "function (日本語)"

m
m
 
Line 22: Line 22:
  
 
return utility
 
return utility
<source>
+
</source>
  
  

Latest revision as of 15:28, 20 October 2017

Lua における関数

function foo()

end


ドット記法 (require 用)

  • utility.lua
utility = {}


function utility.options()

end

function utility.assist()

end

return utility


  • main.lua
util = require ('utility')

gamestate = 1

function love.draw()
    if gamestate = 1
        util.options()
    else
       util.assist()
end

そのほかの言語