local DonBG = require("Skins/PyTaikoGreen/Scripts/bg_objects/donbg") local DonBGBase = require("Skins/PyTaikoGreen/Scripts/bg_objects/donbg/base") local TutorialDonBG = setmetatable({}, { __index = DonBGBase }) TutorialDonBG.__index = TutorialDonBG function TutorialDonBG.new(index, player_num, path) local self = setmetatable({}, TutorialDonBG) local base = DonBGBase.new(index, player_num, path) for k, v in pairs(base) do self[k] = v end self.move = anim.move(6000, { total_distance = -self.bg_texture.width, loop = true }) self.move:start() self.overlay_move = tex.get_animation(2) self.overlay_texture = tex.get_texture_info(self.name, "overlay") self.footer_texture = tex.get_texture_info(self.name, "footer") return self end function TutorialDonBG:update(current_time_ms) DonBGBase.update(self, current_time_ms) self.overlay_move:update(current_time_ms) end function TutorialDonBG:draw_textures(fade, y, frame) y = y + 40 for i = 0, 4 do tex.draw_texture(self.name, "background", { frame = 0, fade = fade, x = (i * self.bg_texture.width) + self.move.attribute, y = y }) tex.draw_texture(self.name, "background", { frame = 1, fade = fade, x = (i * self.bg_texture.width) + self.move.attribute, y = y }) end for i = 0, 5 do tex.draw_texture(self.name, "overlay", { frame = frame, fade = fade, x = (i * self.overlay_texture.width) + self.move.attribute * (self.overlay_texture.width / self.bg_texture.width), y = y + self.overlay_move.attribute }) end for i = 0, 4 do tex.draw_texture(self.name, "footer", { frame = 0, fade = fade, x = (i * self.footer_texture.width) + self.move.attribute * (self.footer_texture.width / self.bg_texture.width), y = y + self.overlay_move.attribute }) tex.draw_texture(self.name, "footer", { frame = 1, fade = fade, x = (i * (self.footer_texture.width - 80)) + self.move.attribute * (self.footer_texture.width / self.bg_texture.width), y = (y + 30) + self.overlay_move.attribute }) end end TutorialBackground = {} TutorialBackground.__index = TutorialBackground local COLLAB_PATH = "background/collab/tutorial" function TutorialBackground.new(player_num, bpm) local self = setmetatable({}, TutorialBackground) tex.load_folder(COLLAB_PATH, "bg_normal/bg_0") self.donbg = TutorialDonBG.new(1, player_num, COLLAB_PATH) return self end function TutorialBackground:update(current_ms, bpm) self.donbg:update(current_ms) end function TutorialBackground:handle_good(player_num) end function TutorialBackground:handle_ok(player_num) end function TutorialBackground:handle_bad(player_num) end function TutorialBackground:handle_drumroll(player_num) end function TutorialBackground:handle_balloon(player_num) end function TutorialBackground:handle_gauge(player_num, progress, is_clear, is_rainbow) end function TutorialBackground:draw_back() self.donbg:draw() tex.draw_texture("bg_0", "background") end function TutorialBackground:draw_fore() end function TutorialBackground:destroy() self.donbg:destroy() tex.unload_folder(COLLAB_PATH, "bg_normal/bg_0") end return TutorialBackground