Hi there, I’m fairly new to Lua, and while i’m able to understand concepts like OOP, this has me stomped. Basically, I can’t for the life of me get a sprite to draw, even though in my head logically I see no reason why it’s not drawing. Here is the code:
Gem = class() function Gem:init(x, y) self.x = x self.y = y end function Gem:draw() sprite("Planet Cute:Gem Green", self.x, self.y) end function Gem:touched(touch) end
function setup() firstGem = Gem(WIDTH/2, HEIGHT/2) end function draw() background(0) firstGem:draw() end
Forgive me if there is BBCode for code, couldn’t figure it out. Anyway, as you can see that is fairly barebones code. Any idea why it won’t draw?