Hey, I’m new to Codea and I was wondering what are classes and blank files for? I know I can put more code on them but how would I be able to “link” that code with my main code and use it then. Are there any sites for tips and tutorials such as these? ( I checked the wiki, but most of the links are broken)
Classes are identical to blank files except they include a basic class template using the name that you specify. This just saves you some typing if you intend to make a class.
All the code is executed when you press play — so your classes will be available to all your other files.
For example, if you create a class called MyClass, you can create an instance in your setup() function as follows:
function setup()
foo = MyClass()
-- Do things with foo...
end
function draw()
foo:draw()
end