2025-07-04 19:02:19 +07:00

48 lines
1017 B
Lua

local videoPath = "videos/stressCutscene.ogv"
local song
local videoStream
local video
local module = {}
function module.onCreate(songName)
if songName == "Stress" then
sharedVars.canStart = false
song = songName
videoStream = love.video.newVideoStream(love.filesystem.newFile(videoPath))
videoStream:play()
video = love.graphics.newVideo(videoStream)
video:play()
end
end
function module.onUpdate()
if videoStream then
if not videoStream:isPlaying() then
sharedVars.canStart = true
video = nil
videoStream = nil
end
end
end
function module.onDraw()
if video then
love.graphics.draw(video, 0,0,0,1.5,1.5)
end
end
function module.onClose()
if video then
video:stop()
video:release()
video = nil
videoStream:stop()
videoStream:release()
videoStream = nil
end
end
return module