43 lines
946 B
Lua
43 lines
946 B
Lua
local videopath = "videos/darnellCutscene.ogv"
|
|
local video = love.graphics.newVideo(videopath)
|
|
|
|
local module = {}
|
|
local started = false
|
|
|
|
function module.onCreate()
|
|
if gameMode == "storymode" then
|
|
-- print("evil")
|
|
video:play()
|
|
sharedVars.canStart = false
|
|
sharedVars.shouldCountdown = false
|
|
sharedVars.cutscene = true
|
|
end
|
|
end
|
|
|
|
function module.onUpdate()
|
|
if not video:isPlaying() and not started then
|
|
-- print("evil")
|
|
sharedVars.canStart = true
|
|
sharedVars.shouldCountdown = true
|
|
started = true
|
|
sharedVars.cutscene = false
|
|
|
|
end
|
|
end
|
|
|
|
function module.drawAboveCanvas()
|
|
if not started then
|
|
-- print("evil")
|
|
love.graphics.draw(video, 0, 0, 0, 1280 / video:getWidth(), 720 / video:getHeight())
|
|
end
|
|
end
|
|
|
|
function module.onClose()
|
|
if video then
|
|
video:pause()
|
|
video:release()
|
|
video = nil
|
|
end
|
|
end
|
|
|
|
return module |