my code:
DEBUG = trueSTRICT = truerequire 'zoetrope'
Frogface = Animation:extend{ width = 100, height = 100, image = 'assets/froganimation.png',
sequences = { talk = { frames = {1, 2}, fps = 10 } },
onUpdate = function(self) self:play('talk') end}
Dialog = Text:extend{ dialog = 0, font = 14, width = 300, height = 20,
onUpdate = function (self)
if self.dialog == 0 then self.tint = {0,0,0} self.text = 'there is a disturbance in the solar system. the mystery of the season.' end if self.dialog == 1 then self.tint = {0,0,0} self.text = 'the mystery of the season the mystery of the season the mystery of the season.' end if self.dialog == 2 then self.tint = {0,0,0} self.text = 'today the mystery will land.' end if self.dialog == 3 then self.tint = {0,0,0} self.text = 'be of care..............' end
if the.keys:justPressed(' ') then self.dialog = self.dialog + 1 if self.dialog == 3 then self:remove(the.app.frogface) end end
end
}
DialogBox = Tile:extend{ width = 742, height = 160, image = 'assets/dialogbox.png'
}
the.app = App:new{
onRun = function(self) self:add(Fill:extend {width = 800, height = 600, fill = {255,255,255} } ) self.dialogbox = DialogBox:new{x = 24, y = 424} self:add(self.dialogbox) self.frogface = Frogface:new{x = 56, y = 456} self:add(self.frogface) self.dialog = Dialog:new{x = 176, y = 456} self:add(self.dialog) end
}