Background = {} Background.__index = Background function Background.new(player_num, bpm, scene_preset) local self = setmetatable({}, Background) self.player_num = player_num self.bpm = bpm self.scene_preset = scene_preset print(string.format("Background created: player=%d, bpm=%.1f, scene=%s", player_num, bpm, scene_preset)) tex.load_animations("background") tex.load_folder("background/bg_normal", "bg_0") tex.load_folder("background/donbg", "0_1") self.donbg_anim = tex.get_animation(0) return self end function Background:update(current_ms) self.donbg_anim:update(current_ms) end function Background:handle_good(player_num) end function Background:handle_ok(player_num) end function Background:handle_bad(player_num) end function Background:handle_drumroll(player_num) end function Background:handle_balloon(player_num) end function Background:draw_back() local bg_texture = tex.get_texture_info("0_1", "background") for i = 0, 5, 1 do tex.draw_texture("0_1", "background", {x = self.donbg_anim.attribute + (i*bg_texture.width)}) end tex.draw_texture("bg_0", "background") end function Background:draw_fore() end function Background:destroy() end