From c02c15e79f1b9170e75d0fae9e1c4361ee4563d7 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Thu, 8 Feb 2024 21:52:04 -0800 Subject: [PATCH] fade the title screen in also the ditherer automatically decides which way to go --- vacation.p8 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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