This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DrawCanvas = class() | |
function DrawCanvas:init(x) | |
-- create an off screen image to hold what is being drawn | |
self.canvas = image(1024, 768) | |
-- set the default pen color, this will change for each line drawn | |
self.penColor = color(255, 255, 255, 255) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Animation class | |
Animation = class() | |
function Animation:init(sheet, numFrames, columns, width, height, delay) | |
-- load each animation frame in the sheet into a seperate image. | |
frames = {} | |
row = 1 | |
column = 1 | |
for i = 1, 32 do |