Skip to content

Instantly share code, notes, and snippets.

@NerfedWar
NerfedWar / DrawCanvas.lua
Created May 28, 2013 19:52
AutoGist your Codea projects!
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)
@NerfedWar
NerfedWar / Animation.lua
Created May 28, 2013 18:50
AutoGist your Codea projects!
-- 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