Files
PyTaikoGreen/Scripts/bg_objects/donbg/3.lua
T
2026-02-21 13:32:37 -05:00

54 lines
1.7 KiB
Lua

local DonBGBase = require("Skins/PyTaikoGreen/Scripts/bg_objects/donbg/base")
DonBG3 = setmetatable({}, { __index = DonBGBase })
DonBG3.__index = DonBG3
function DonBG3.new(index, player_num, path)
local self = setmetatable({}, DonBG3)
local base = DonBGBase.new(index, player_num, path)
for k, v in pairs(base) do
self[k] = v
end
self.bounce_up = tex.get_animation(4)
self.bounce_down = tex.get_animation(5)
self.bounce_up:start()
self.bounce_down:start()
self.overlay_move = tex.get_animation(6)
self.overlay_move_2 = tex.get_animation(7)
self.overlay_texture = tex.get_texture_info(self.name, "overlay")
return self
end
function DonBG3:update(current_time_ms)
DonBGBase.update(self, current_time_ms)
self.bounce_up:update(current_time_ms)
self.bounce_down:update(current_time_ms)
if self.bounce_down.is_finished then
self.bounce_up:restart()
self.bounce_down:restart()
end
self.overlay_move:update(current_time_ms)
self.overlay_move_2:update(current_time_ms)
end
function DonBG3:draw_textures(fade, y, frame)
for i = 0, 10 do
tex.draw_texture(self.name, "background", {
frame = frame,
fade = fade,
x = (i * self.bg_texture.width) + self.move.attribute,
y = y
})
end
local y_pos = self.bounce_up.attribute - self.bounce_down.attribute + self.overlay_move.attribute + self.overlay_move_2.attribute
for i = 0, 6 do
tex.draw_texture(self.name, "overlay", {
frame = frame,
fade = fade,
x = (i * self.overlay_texture.width) + (self.move.attribute * 2),
y = y_pos + y
})
end
end
return DonBG3