diff --git a/CREDITS b/CREDITS index 36f5564..183640f 100644 --- a/CREDITS +++ b/CREDITS @@ -5,8 +5,9 @@ All writing is by me, unternehmen! All graphics were hand-made by me, unternehmen! ## Music -The music and sound effects were collected from the OpenGameArt.org website. -All of them had been released under the CC-0 license when this game was made: +The music and sound effects were collected from OpenGameArt.org and +Soundbible.com. All of them had been released under the CC-0 license +or were in the public domain when this game was made. "city.mp3" is from "Atmospheric Puzzles" by legoluft: https://opengameart.org/content/atmospheric-puzzles @@ -30,5 +31,9 @@ All of them had been released under the CC-0 license when this game was made: "primord.mp3" is "Ancient Fairytale" by Oddroom: https://opengameart.org/content/ancient-fairytale -Sound effects are from "Atmospheric Interaction Sound Pack" by legoluft: - https://opengameart.org/content/atmospheric-interaction-sound-pack +Most sound effects are from "Atmospheric Interaction Sound Pack" by legoluft: + https://opengameart.org/content/atmospheric-interaction-sound-pack + +The dial-up connection sound is by ezwa and is from soundbible.com: + http://soundbible.com/136-Dial-Up-Modem.html + diff --git a/dialog.lua b/dialog.lua index 5836cb3..abdf0e0 100644 --- a/dialog.lua +++ b/dialog.lua @@ -5,6 +5,7 @@ local typingstate = {} local waitingstate = {} local choosingstate = {} local fadingstate = {} +local pausingstate = {} -- The default dialog state is "inactive". dialog.currentstate = inactivestate @@ -29,12 +30,6 @@ local function drawletterbox() end --- Inactive state -function inactivestate.draw() - drawletterbox() -end - - -- Typing state function typingstate.update() @@ -46,6 +41,7 @@ function typingstate.update() bloop:play() if dialog.lettersshown == #dialog.currentmessage then + dialog.animationtimer = 0 dialog.currentstate = waitingstate end end @@ -55,8 +51,6 @@ function typingstate.draw() assert(dialog.currentmessage ~= nil, 'dialog.currentmessage is nil') assert(dialog.lettersshown ~= nil, 'dialog.lettersshown is nil') - drawletterbox() - love.graphics.setFont(font) love.graphics.setColor(255, 255, 255, 255) love.graphics.print(string.sub(dialog.currentmessage, @@ -67,17 +61,22 @@ end -- Waiting state +function waitingstate.update() + assert(dialog.animationtimer ~= nil, 'dialog.animationtimer is nil') + + dialog.animationtimer = (dialog.animationtimer + 1) % 50 +end + function waitingstate.draw() assert(dialog.currentmessage ~= nil, 'dialog.currentmessage is nil') - - drawletterbox() + assert(dialog.animationtimer ~= nil, 'dialog.animationtimer is nil') love.graphics.setFont(font) love.graphics.setColor(255, 255, 255, 255) love.graphics.print(dialog.currentmessage, 0, 90) - love.graphics.setColor(255, 255, 255, 255) - love.graphics.rectangle('fill', virtualwidth - 16, virtualheight - 16, 16, 16) + love.graphics.setColor(255, 255, 255, (255 / 25) * math.abs(dialog.animationtimer - 25)) + love.graphics.rectangle('fill', virtualwidth - 5, virtualheight - 5, 3, 3) end function waitingstate.mousepressed(x, y, button, istouch) @@ -92,8 +91,6 @@ end function choosingstate.draw() assert(dialog.choices ~= nil, 'dialog.choices is nil') - drawletterbox() - -- Draw the choices. love.graphics.setFont(font) @@ -140,6 +137,20 @@ function choosingstate.mousepressed(x, y, button, istouch) end +-- Pausing state + +function pausingstate.update() + requirethread() + assert(dialog.pausetimer ~= nil, 'dialog.pausetimer is nil') + + if dialog.pausetimer == 0 then + coroutine.resume(dialog.thread) + else + dialog.pausetimer = dialog.pausetimer - 1 + end +end + + -- Fading state function fadingstate.update() @@ -174,8 +185,6 @@ end function fadingstate.draw() assert(dialog.fadeopacity ~= nil, 'dialog.fadeopacity is nil') - drawletterbox() - love.graphics.setColor(0, 0, 0, dialog.fadeopacity) love.graphics.rectangle('fill', 0, 0, virtualwidth, virtualheight) end @@ -208,7 +217,10 @@ do end dialog.update = statecallerproc('update') - dialog.draw = statecallerproc('draw') + dialog.draw = function () + drawletterbox() + runifdefined(dialog.currentstate.draw) + end dialog.mousemoved = statecallerproc('mousemoved') dialog.mousepressed = statecallerproc('mousepressed') dialog.keypressed = statecallerproc('keypressed') @@ -238,6 +250,14 @@ function dialog.choose(...) return result end +function dialog.pause(duration) + dialog.pausetimer = duration + dialog.currentstate = pausingstate + coroutine.yield() + dialog.pausetimer = nil + dialog.currentstate = inactivestate +end + function dialog.fadein(duration) dialog.fadeopacity = 255 dialog.fadedirection = 'in' diff --git a/main.lua b/main.lua index b998fd4..3b71fa5 100644 --- a/main.lua +++ b/main.lua @@ -41,6 +41,7 @@ function love.load() confirm = love.audio.newSource('sounds/confirm.wav', 'static') bloop = love.audio.newSource('sounds/bloop.wav', 'static') anchor = love.audio.newSource('sounds/anchor.wav', 'static') + dial = love.audio.newSource('sounds/dial.wav', 'static') currentbgmusic = nil -- debug font diff --git a/room-call.lua b/room-call.lua index db77ac9..4e27f0a 100644 --- a/room-call.lua +++ b/room-call.lua @@ -11,58 +11,65 @@ end function room.draw() -- Draw Jyesula with the scanline effect. - love.graphics.setCanvas(scancanvas) - love.graphics.push() - love.graphics.scale(0.25, 0.25) - love.graphics.clear(0, 0, 0, 0) + if jyesulavisible then + love.graphics.setCanvas(scancanvas) + love.graphics.push() + love.graphics.scale(0.25, 0.25) + love.graphics.clear(0, 0, 0, 0) - love.graphics.draw(scanline, 0, scanlineoffset + 69) - love.graphics.draw(scanline, 0, scanlineoffset) - love.graphics.pop() - love.graphics.setCanvas() - love.graphics.setCanvas(canvas) - love.graphics.push() - love.graphics.scale(0.25, 0.25) - love.graphics.clear(0, 0, 0, 0) - love.graphics.setBlendMode('alpha') - love.graphics.draw(jyesula, 0, 0) - love.graphics.setBlendMode('multiply') - love.graphics.draw(scancanvas) - love.graphics.setBlendMode('alpha') - love.graphics.pop() - love.graphics.setCanvas() - love.graphics.draw(canvas, 0, 0) + love.graphics.draw(scanline, 0, scanlineoffset + 69) + love.graphics.draw(scanline, 0, scanlineoffset) + love.graphics.pop() + love.graphics.setCanvas() + love.graphics.setCanvas(canvas) + love.graphics.push() + love.graphics.scale(0.25, 0.25) + love.graphics.clear(0, 0, 0, 0) + love.graphics.setBlendMode('alpha') + love.graphics.draw(jyesula, 0, 0) + love.graphics.setBlendMode('multiply') + love.graphics.draw(scancanvas) + love.graphics.setBlendMode('alpha') + love.graphics.pop() + love.graphics.setCanvas() + love.graphics.draw(canvas, 0, 0) + end end local function introaction() backdrop = love.graphics.newImage('images/comm.png') + currentbgmusic:setVolume(0.1) + dial:play() dialog.fadein(200) + dialog.pause(400) + jyesulavisible = true + dialog.pause(20) + currentbgmusic:setVolume(1.0) - switchbgmusic(shipmusic) say 'Do you have news, Agent?' local result = choose('Uh...', 'Is your refridgerator running?', 'Apologies, wrong number.') if result == 2 then - say '... I am disconnecting.' + say 'Please do your job, Agent.' elseif result == 3 then say 'Good luck, Agent.' end dialog.fadeout(200) - anchor:play() rooms.enter(rooms.ship) end function room.enter() scanlineoffset = 0 + jyesulavisible = false objects = {} dialog.start(introaction) end -return room \ No newline at end of file +return room diff --git a/sounds/dial.wav b/sounds/dial.wav new file mode 100644 index 0000000..d6765d9 Binary files /dev/null and b/sounds/dial.wav differ