When I try to compile the following code, there seems to be an error with the last method.(Blip:draw)
The function declaration line is highlighted in red but there is no message indicating what it thinks is wrong.
When I swap the order of the methods in the file, the error changes to the last method in the file. But still no error message.
Is there a way to get an error message so I can tell what is going wrong?
thanks
peter
Blip = class()
function Blip:init(x, y, q)
-- you can accept and set parameters here
self.x = x
self.y = y
self.q = q
self.spriteFlag = 0
end
function Blip:touched(touch)
-- Codea does not automatically call this method
if (self.spriteFlag == 0) then
self.spriteFlag = 1
else
self.spriteFlag = 0
end
function Blip:draw(x, y)
-- Codea does not automatically call this method
if (self.spriteFlag == 0) then
sprite("Small World:Chest", x + self.x, y + self.y)
else
sprite("Small World:Chest Bottom", x + self.x, y + self.y)
end