lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Wed, Feb 10, 2010 at 10:31:02PM -0800, Joe Andresen wrote:

> MainState.addCamera(T)

Try 'MainState:addCamera(T)'.


> local M = {}
> M = _G.Class()
> GameState = M

This creates and immediately throws away a table, is that the intention?


> function M:addCamera(camera) --this is nil.. what the heck?
>     self.Cameras[camera.getID()] = camera
> end

This creates a function which expects two arguments, self and camera. Your
call only passes one. Check "self" you'll see it is your camera.

> thanks for any help!
> -Joe