Can someone explain why this code is failing:
local rect = display.newRect(0, 0, 30, 40)
rect:setFillColor(100,100,100,255)
local t = {}
rect = setmetatable(rect, t)
t.__index = t
rect.x = 100
rect.y = 100
– rectangle does not move from 0, 0
– unless you remove the “setmetatable(rect, t)” line
– eg comment out this line
–rect = setmetatable(rect, t)
– then it draw at 100, 100
What’s the problem with treating my objects as objects?? [import]uid: 6175 topic_id: 1679 reply_id: 301679[/import]