diff --git a/vacation.p8 b/vacation.p8 index 0017f2c..c6e424e 100644 --- a/vacation.p8 +++ b/vacation.p8 @@ -656,9 +656,9 @@ def_15_fade = split"0,0,128,129,133,141,13,13,6,6,15,15,7" def_13_fade = split"0,0,0,0,0,128,129,133,141,140,140,13,12" def_shd_fade = split"0,0,0,128,130,141,2" --- frames per character to wait --- during zonk text display. -fchr=2 +-- frames between words during +-- zonk txt +fbw=8 zonk_mode = { files={}, @@ -763,25 +763,24 @@ end function zonk_mode:next_item() if not self.line then if (not self.file or #self.file == 0) return + local line = deli(self.file, 1) if self.expect_cfg_line then self.expect_cfg_line = false - local cfg_line = deli(self.file, 1) - for i,cmd in ipairs(split(cfg_line, " ")) do + for i,cmd in ipairs(split(line, " ")) do if #cmd > 0 then local frags = split(cmd,":") - assert(type(self[frags[1]])=="function", tostr(i).." - "..cfg_line) + assert(type(self[frags[1]])=="function", tostr(i).." - "..line) self[frags[1]](self, unpack(frags)) end end return self:next_item() end - local line = deli(self.file, 1) if line == "-----" then self.line = nil self.expect_cfg_line = true - self.cx,self.cy = 0,0 + self.cx = 0 self.cy = 0 - return 0, nil + return nil end self.line = split(line, " ") end @@ -800,13 +799,11 @@ function zonk_mode:next_item() end local pp,cmult=nrm_txt_pal,1 if (token[1]==">") token,self.cx=sub(token,2),self.cx+self.spc_full\2 - if (token[1]=="$") token,cmult=sub(token,2),2 - if (token[1]=="^") token,cmult=sub(token,2),0.5 if (token[1]=="!") token,pp=sub(token,2),sfd_txt_pal if (token[1]=="#") token,pp=sub(token,2),hlt_txt_pal local ret = zonk_txt(token,self.cx,self.cy,pp,self.txmd,self.txf,self.txd*cmult) self.cx = ret.eff_w+self.spc_full - return #token,ret + return ret end function zonk_mode:empty() @@ -823,19 +820,13 @@ function zonk_mode:update() if self.playing_text then self.twt -= 1 if self.twt <= 0 then - local cn,item = self:next_item() - if not cn then - self:next_file() + local item = self:next_item() + if not item then + if (not self.file or #self.file == 0) self:next_file() self.playing_text=false - elseif cn < 0 then - self.twt = -cn else - self.twt = cn*fchr*self.cmul - end - if item then self.txt_frame:push(item) - else - self.playing_text=false + self.twt = fbw*self.cmul end end else @@ -1796,6 +1787,7 @@ sunset_pal=split"12,13,14,8,137,9,10,129,1,130,2,140,5,6,7" function ggwp:draw() pal() + camera() clear_alt_pal_bits() pal(sunset_pal,1) for i=0,5 do