Skip to content

Instantly share code, notes, and snippets.

@rameshvarun rameshvarun/cutscene1.lua Secret
Created Sep 4, 2017

Embed
What would you like to do?
self.cutscene1 = Actions.Sequence(
Actions.Do(function()
self.cam:lookAt(700, 200)
loader.Audio.Stream.prison:setLooping(true)
love.audio.play(loader.Audio.Stream.prison)
end),
Actions.Tween(5.0, self.cam, {x = 400, y = 200}, 'linear'),
Actions.Wait(3.0),
Actions.Do(function()
love.audio.play(loader.Audio.Static.siren)
self.timer.every(10, function()
love.audio.play(loader.Audio.Static.siren)
end)
end),
Actions.Wait(2.0),
Actions.Parallel(
Actions.Tween(5.0, self.cam, {y = 300}, 'out-sine'),
Actions.Sequence(
Actions.Tween(3.0, self.stunGuard, {pos = self.combatgrid1:center(vector(7, 3))}, 'out-sine'),
Actions.Do(function()
self.stunGuard:bark(i18n.translate('intromission.dialogue1'), 3.0)
end)
)
),
Actions.Wait(1.0),
Actions.Parallel(
Actions.Tween(5.0, self.cam, {y = 180}, 'out-sine'),
Actions.Sequence(
Actions.Wait(0.5),
Actions.Do(function()
self.bars[4]:fadeOut(1.0)
love.audio.play(loader.Audio.Static.latch)
end),
Actions.Wait(1),
Actions.Do(function()
self.bars[3]:fadeOut(1.0)
love.audio.play(loader.Audio.Static.latch)
end),
Actions.Wait(1),
Actions.Do(function()
self.bars[1]:fadeOut(1.0)
love.audio.play(loader.Audio.Static.latch)
end),
Actions.Wait(1),
Actions.Do(function()
self.bars[2]:fadeOut(1.0)
love.audio.play(loader.Audio.Static.latch)
end),
Actions.Wait(2)
)
),
Actions.Do(function()
self.stunGuard:bark(i18n.translate('intromission.dialogue2'), 3.0)
end),
Actions.Wait(4.0),
Actions.Parallel(
Actions.Tween(3.0, self.cam, {y = 300}, 'in-out-sine'),
Actions.Tween(2.0, self.player, {pos=self.combatgrid1:center(vector(2, 3))}, 'linear')
),
Actions.Do(function()
self.combatgrid1:startCombat(function()
self.player:setHP(self.player:getMaxHP())
self.stunGuard:setHP(self.stunGuard:getMaxHP())
self.combatgrid1:addUnit(vector(2, 3), self.player)
self.combatgrid1:addUnit(vector(7, 3), self.stunGuard)
end, function()
self.tempHealth = self.player:getHP()
self.cutscene2(self.timer, function() end)
end)
end),
Actions.Parallel(
Actions.Sequence(
Actions.Tween(2.0, self.prisoners[7], {pos = vector(666, 350)}, 'linear'),
Actions.Tween(3.0, self.prisoners[7], {pos = vector(800, 350)}, 'linear'),
Actions.DestroyEntity(self.prisoners[7])
),
Actions.Sequence(
Actions.Tween(3.0, self.prisoners[6], {pos = vector(627, 308)}, 'linear'),
Actions.Tween(2.0, self.prisoners[6], {pos = vector(666, 350)}, 'linear'),
Actions.Tween(3.0, self.prisoners[6], {pos = vector(800, 350)}, 'linear'),
Actions.DestroyEntity(self.prisoners[6])
)
),
Actions.Do(function()
self.timer.every(15, function()
local prisoner = self:addEntity(Prisoner(2, vector(0, love.math.random(466, 500))))
prisoner.velocity = vector(100, 0)
self.timer.after(80, function()
prisoner:destroy()
end)
end)
end)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.