title: attempt to call method 'func' (a nil value)
body: <p>No matter how I approach Lua, I run into this error all the time, so I must not understand something inherit to the language:</p>
  
  <blockquote>
    <p>attempt to call method 'func' (a nil value)</p>
  </blockquote>
  
  <p>I've seen the error here a few times as well but the problem doesn't seem clear to me.</p>
  
  <p>Here's my module:<br>
  actor.lua</p>
  
  <pre><code>Actor = {
      x = 0,
      mt = {},
  
      new = function()
          local new_actor = {}
          new_actor.x = Actor.x
          new_actor.mt = Actor.mt
          return new_actor
      end,
  
      test = function(self, a, b)
          print(a, b)
      end
  }
  </code></pre>
  
  <p>I'm using Löve.<br>
  main.lua</p>
  
  <pre><code>require "game/actor"
  local a = Actor:new() --works fine
  
  function love.load()
      a.x = 10
      print(a.x) --output: 10
      a:test(11, 12) --error: attempt to call method 'test' (a nil value)
  end
  </code></pre>
  
  <p>I'm also not sure when it's appropriate to use the previous styling over this in a module.</p>
  
  <pre><code>Actor = {
      x = 0
  }
  Actor.mt = {}
  
  function Actor.new()
      print(42)
  end
  </code></pre>
  
  <p>I'm honestly not sure what is more correct than the other but considering I run into a simple error either way, there's probably something I'm missing entirely?</p>