Hi All. Have been scratching my head over this one. The below code works fine, with the correct function being called dependant on the value of status
-- Tester
function setup()
status=up
end
function draw()
status ()
end
function up()
print "up"
status=down
end
function down ()
print "down"
status=up
end
However when I try and have a similar set up within a Class, I get an error and Test:self.status() is not acceptable. What is the correct syntax or am I missing something.
-- Tester
function setup()
test=Test()
end
function draw()
test:draw()
end
function Test:init()
self.status=up
end
function Test:draw()
Test:self.status()
end
function Test:up()
print "up"
self.status=down
end
function Test:down()
print "down"
self.status=up
end
Thanks for any help.