Hi technocat,
I've found the problem. It was this tween in Elevator.lua:
Code: Select all
tween(
Passenger.TWEEN_TIME,
passenger,
{x=self.x, y=passenger.y, alpha=0},
'inOutCubic',
table.remove(self.passengers, #self.passengers))
The issue was on the last line; the callback must be a function (in your case, it was the result of executing table.remove, which as a person instance. Tween was trying to apply the __call metamethod to that person instance.
You can either wrap that last line within an anonymous function, like this:
Code: Select all
tween(
Passenger.TWEEN_TIME,
passenger,
{x=self.x, y=passenger.y, alpha=0},
'inOutCubic',
function() table.remove(self.passengers, #self.passengers) end)
Or put the function followed by its parameters:
Code: Select all
tween(
Passenger.TWEEN_TIME,
passenger,
{x=self.x, y=passenger.y, alpha=0},
'inOutCubic',
table.remove, self.passengers, #self.passengers)
Beware, though: on the first case #self.passengers will be evaluated when the tween finishes, and on the second it will be evaluated when the tween starts.ç
I've used the first option and it seems to work just fine. Attaching the result.
EDIT: oh and by the way, sorry for the time it took me to answer to this.