diff --git a/vacation.p8 b/vacation.p8 index 42f5cd2..ca6121c 100644 --- a/vacation.p8 +++ b/vacation.p8 @@ -391,7 +391,9 @@ ditherer = { c=0, pattern=fadetable, } -mknew(ditherer) +mknew(ditherer, function(x) + if (x.di and x.di < 0 and not x.i) x.i = (x.pattern and #x.pattern or #fadetable) + 0.99 +end) function ditherer:update() self.i += self.di @@ -424,7 +426,11 @@ function newtitle() end title_screen = {} -mknew(title_screen) +mknew(title_screen, function(t) + t.d = ditherer.new{ + di = -1 + } +end) function title_screen:activate() font_dogica() @@ -436,9 +442,11 @@ function title_screen:draw() cls(12) print("title screen", 30, 57, 0) print("press right arrow", 15, 66, 0) + self.d:draw() end function title_screen:update() + self.d:update() if (btnp(1)) start_game() end -->8