Develop #4
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,38 @@
|
|||||||
|
require 'assets/scripts/vendor/MessageInABottle'
|
||||||
|
|
||||||
|
local messages = {}
|
||||||
|
local duration = 30
|
||||||
|
|
||||||
|
function messages.load()
|
||||||
|
ocean = Ocean:new()
|
||||||
|
end
|
||||||
|
|
||||||
|
function messages.update(dt)
|
||||||
|
ocean:update(dt)
|
||||||
|
end
|
||||||
|
|
||||||
|
function messages.draw()
|
||||||
|
ocean:draw()
|
||||||
|
end
|
||||||
|
|
||||||
|
function messages.new_message(cap)
|
||||||
|
local texts = {}
|
||||||
|
texts.welcome = "Debo tomar una decisión. No saldré de esta habitación hasta que tenga claro si mataré o dejaré vivir a mi novia. ¿Qué ha pasado en mi vida para que haya llegado hasta aquí? Tengo poco tiempo. Su vida se tambalea entre mis dedos."
|
||||||
|
texts.cap1preview="Esta preciosa en esta foto. Mi madre me ha dado mucho más de lo que yo nunca podré devolverle. No solo me otorgó la vida, sino una razón para continuarla. Sus enseñanzas y duro caracteres me ha ayudado a ser el hombre que soy ahora. Lo que más deseo en este mundo es que se sienta orgulloso de mi. De mi trabajo y mi pareja. Pero una zorra lo estropeó todo."
|
||||||
|
texts.cap1stage="Se meó en lo que yo más amaba. Me atacó en todo lo que mi madre me enseñó y mis más profundas creencias. No creo de forma poco clara, como mis hermanos, sino de verdad. Y esta niña no hizo más que ridiculizarme. Reírse delante de mis amigos. Llamarme loco en la intimidad. Tacharme de primitivo. Imbécil. Equivocado.... Pero la idiota es ella, la inmoral, la pecadora, la puta…. Necesito calmarme, relajar mi mente. Oír la palabra del Señor. Si salgo en este estado la voy a matar. Debo serenarme para pensar con claridad. ¡Señor, háblame!"
|
||||||
|
texts.cap2stage="Corintios 12:10 Por lo cual, por amor a Cristo me gozo en las debilidades, en afrentas, en necesidades, en persecuciones, en angustias; porque cuando soy débil, entonces soy fuerte. Igual de fuerte que me hizo ella. Se reía delante de mis amigos, pero para ayudarme a superar la timidez. Me llamaba loco para mejorar mis hábitos, para hacerme ver las manías que había aprendido de mi madre. Primitivo cuando no era tolerante con los demás. Y yo solo me enfadaba… como un imbécil. Una pequeña parte de mi alma le pertenece. Pero no debo olvidar donde la conocí, donde alquilé sus primeros besos. Mis padres nunca deben saber la verdad. Mi madre no debe averiguar que humos aspiré, cuantas copas bebí esa noche. Debo destruir este papel. Nadie debe verlo."
|
||||||
|
texts.cap3stage="Mientras el humo exploraba mis fosas nasales, recordé las barbacoas que hacíamos todos los sábados con mi familia. A ella la adoraban mis primos, y les caía muy bien a mis tíos. Mi padre siempre le hablaba sobre trucos de pesca, y mi madre la cuidaba como si fuera su propia hija. Estaba totalmente integrada a la familia. Por lo que la invitamos a venir a una barbacoa. Y entonces, mientras bendecíamos la mesa, ella se puso a comer. En el silencio se escuchó su boca mascando una grasienta salchicha. Todos la miraron sin aliento, y a continuación a mi con una mueca de indignación. No podía creer que estuviera sucediendo. La llevé a parte, a la cabaña de la leña. Lo que allí le dije no se borrará fácilmente de su memoria. Nunca conocí a una persona tan poco sensible… tan tan… y para disculparse nos regaló un jodido disco. ¿Piensa que puede comprarnos? Menuda mierda de regalo."
|
||||||
|
texts.cap4stage="Me encanta esta canción. Ya recuerdo porque nos lo regaló. En el disco estaba nuestra canción. Una disculpa escondida a mi. Tal vez me alteré más de lo que tocaba. Después de todo ella no es religiosa, nunca había bendecido una mesa. Ni siquiera había visto cómo se realizaba. Hizo lo que cualquier otra persona hubiera hecho: sentarse y comer. Pobreta. No tuve que coger el disco, sus lágrimas eran más que suficientes. Nunca buscó hacer daño. Pero en cambio yo sí… ahora debo matarla. Lo tengo que hacer antes de que diga más mentiras sobre mi. Que manche mi imagen familiar. No lo puedo permitir. No soy gay. No estoy enfermo. No pienso usar esta llave. Saldré por la puerta y acabaré con ella. Se acabó los recuerdos, ya he tomado una decisión."
|
||||||
|
texts.endbad="Muere puta"
|
||||||
|
texts.endgood="Mi sujetador. Qué incómodo es. Siempre he odiado llevarlo, me hacen daño en los pechos. En nuestro primer aniversario secreto me regaló un conjunto. Me ha comprendido. Me ha ayudado siempre a crecer. A romper ataduras. Como la que me encuentro ahora. Decir a mi madre que soy una mujer que ama a otras… mujeres. Y que el Señor solo quiere que yo sea feliz. Tengo que ser fuerte. Corintios 12:10 Por lo cual, por amor a Cristo me gozo en las debilidades, en afrentas, en necesidades, en persecuciones, en angustias; porque cuando soy débil, entonces soy fuerte. Gracias mi amor."
|
||||||
|
local bottle = TimeBottle:new(cap, texts['' .. cap], duration)
|
||||||
|
bottle:setX(30)
|
||||||
|
bottle:setY(500)
|
||||||
|
bottle:setWidth(1220)
|
||||||
|
bottle:setHeight(140)
|
||||||
|
bottle:setVolume(0)
|
||||||
|
ocean:addBottle(bottle)
|
||||||
|
end
|
||||||
|
|
||||||
|
return messages
|
||||||
|
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
local stack = {}
|
||||||
|
|
||||||
|
function love.graphics.pushState()
|
||||||
|
--get state
|
||||||
|
local state = {}
|
||||||
|
state.blendMode = love.graphics.getBlendMode()
|
||||||
|
state.color = {love.graphics.getColor()}
|
||||||
|
state.font = love.graphics.getFont() or 12
|
||||||
|
state.lineStyle = love.graphics.getLineStyle()
|
||||||
|
state.scissor = love.graphics.getScissor() or
|
||||||
|
{love.graphics.getScissor()} or
|
||||||
|
{0,0,love.graphics.getWidth(), love.graphics.getHeight()}
|
||||||
|
|
||||||
|
-- push state
|
||||||
|
stack[#stack+1] = state
|
||||||
|
end
|
||||||
|
|
||||||
|
function love.graphics.popState()
|
||||||
|
-- restore state
|
||||||
|
local state = stack[#stack]
|
||||||
|
love.graphics.setBlendMode( state.blendMode )
|
||||||
|
love.graphics.setColor( unpack(state.color) )
|
||||||
|
love.graphics.setFont( state.font )
|
||||||
|
love.graphics.setScissor( unpack(state.scissor) )
|
||||||
|
|
||||||
|
-- pop state
|
||||||
|
stack[#stack] = nil
|
||||||
|
end
|
||||||
|
|
||||||
+463
@@ -0,0 +1,463 @@
|
|||||||
|
--[[
|
||||||
|
MessageInABottle.lua - 2010-11-08
|
||||||
|
http://bitbucket.org/dannyfritz/message-in-a-bottle/
|
||||||
|
Danny "TechnoCat" Fritz dannyfritz@gmail.com
|
||||||
|
Commons Attribution-ShareAlike 3.0
|
||||||
|
--]]
|
||||||
|
|
||||||
|
--An OO library for Lua by Kikito,
|
||||||
|
--can be found at https://github.com/kikito/middleclass
|
||||||
|
require 'assets/scripts/vendor/MiddleClass'
|
||||||
|
require 'assets/scripts/vendor/GraphicsStateStack'
|
||||||
|
|
||||||
|
|
||||||
|
MessageBottle = class('MessageBottle')
|
||||||
|
TimeBottle = MessageBottle:subclass('TimeBottle')
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Default values
|
||||||
|
--]]
|
||||||
|
MessageBottle.DEFAULT_SOUND = 'assets/audio/fx/messages/blip.ogg'
|
||||||
|
MessageBottle.DEFAULT_VOLUME = 0.5
|
||||||
|
MessageBottle.DEFAULT_BUTTON = ' ' --Button to close/select
|
||||||
|
MessageBottle.DEFAULT_INDICATOR = love.graphics.newImage('assets/sprites/messages/input-indicator.png') --Image to
|
||||||
|
|
||||||
|
MessageBottle.DEFAULT_X = 20
|
||||||
|
MessageBottle.DEFAULT_Y = 180
|
||||||
|
MessageBottle.DEFAULT_WIDTH = 300
|
||||||
|
MessageBottle.DEFAULT_HEIGHT = 80
|
||||||
|
|
||||||
|
MessageBottle.DEFAULT_FONT = love.graphics.newFont(18)
|
||||||
|
MessageBottle.DEFAULT_ALIGN = 'left'
|
||||||
|
MessageBottle.DEFAULT_FGCOLOR = {r=255,g=255,b=255}
|
||||||
|
MessageBottle.DEFAULT_FGALPHA = 1
|
||||||
|
|
||||||
|
MessageBottle.DEFAULT_BGRADIUS = 10 --pixels to draw the rounded corners
|
||||||
|
MessageBottle.DEFAULT_BGRADIUSSEGMENTS = 32 --how precisely to draw the circle
|
||||||
|
MessageBottle.DEFAULT_BGCOLOR = {r=0,g=0,b=0}
|
||||||
|
MessageBottle.DEFAULT_BGALPHA = 0.8
|
||||||
|
|
||||||
|
MessageBottle.DEFAULT_EASETIME = 0.5 --seconds to ease
|
||||||
|
MessageBottle.DEFAULT_FADETIME = 0.3 --seconds to fade alpha
|
||||||
|
MessageBottle.DEFAULT_EASEOFFSET = 10
|
||||||
|
|
||||||
|
MessageBottle.DEFAULT_ID = "NO_ID"
|
||||||
|
MessageBottle.DEFAULT_TEXT = "Text is not set."
|
||||||
|
|
||||||
|
TimeBottle.TIMEOUT = 6 --seconds to keep the bottle alive
|
||||||
|
|
||||||
|
function MessageBottle:drawBackground()
|
||||||
|
--draw background
|
||||||
|
--self.bgAlpha
|
||||||
|
--self.alpha
|
||||||
|
love.graphics.pushState()
|
||||||
|
local r,g,b,a = self.bgColor.r, self.bgColor.g, self.bgColor.b
|
||||||
|
local a = self.bgAlpha * self.alpha
|
||||||
|
local r = self.bgRadius
|
||||||
|
local x,y = self.x, self.y
|
||||||
|
local w,h = self.width, self.height
|
||||||
|
local segments = self.bgRadiusSegments
|
||||||
|
love.graphics.setColor(r,g,b,a)
|
||||||
|
--center rectangle
|
||||||
|
love.graphics.rectangle("fill",
|
||||||
|
x, y,
|
||||||
|
w, h)
|
||||||
|
--top border
|
||||||
|
love.graphics.rectangle("fill",
|
||||||
|
x, y-r,
|
||||||
|
w, r)
|
||||||
|
-- right border
|
||||||
|
love.graphics.rectangle("fill",
|
||||||
|
x+w, y,
|
||||||
|
r, h)
|
||||||
|
--bottom border
|
||||||
|
love.graphics.rectangle("fill",
|
||||||
|
x, y+h,
|
||||||
|
w, r)
|
||||||
|
--left border
|
||||||
|
love.graphics.rectangle("fill",
|
||||||
|
x-r, y,
|
||||||
|
r, h)
|
||||||
|
--top left corner
|
||||||
|
love.graphics.setScissor(
|
||||||
|
x-r, y-r,
|
||||||
|
r, r)
|
||||||
|
love.graphics.circle("fill",
|
||||||
|
x, y,
|
||||||
|
r, segments)
|
||||||
|
--top right corner
|
||||||
|
love.graphics.setScissor(
|
||||||
|
x+w, y-r,
|
||||||
|
r, r)
|
||||||
|
love.graphics.circle("fill",
|
||||||
|
x+w, y,
|
||||||
|
r, segments)
|
||||||
|
--bottom right corner
|
||||||
|
love.graphics.setScissor(
|
||||||
|
x+w, y+h,
|
||||||
|
r, r)
|
||||||
|
love.graphics.circle("fill",
|
||||||
|
x+w, y+h,
|
||||||
|
r, segments)
|
||||||
|
--bottom left corner
|
||||||
|
love.graphics.setScissor(
|
||||||
|
x-r, y+h,
|
||||||
|
r, r)
|
||||||
|
love.graphics.circle("fill",
|
||||||
|
x, y+h,
|
||||||
|
r, segments)
|
||||||
|
love.graphics.popState()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Ocean
|
||||||
|
This is a class to store and invoke the focussed bottles
|
||||||
|
(A queue)
|
||||||
|
--]]
|
||||||
|
Ocean = class('Ocean')
|
||||||
|
|
||||||
|
function Ocean:initialize()
|
||||||
|
super.initialize(self)
|
||||||
|
self.bottles = {}
|
||||||
|
self.response = ""
|
||||||
|
self.responseTime = 0
|
||||||
|
self.responseID = ""
|
||||||
|
self.time = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function Ocean:update(dt)
|
||||||
|
if #self.bottles > 0 then
|
||||||
|
self.time = self.time + dt
|
||||||
|
local bottle = self.bottles[1]
|
||||||
|
if bottle.focusTime == 0 then
|
||||||
|
bottle:enterCallback()
|
||||||
|
end
|
||||||
|
local tmp = self.response
|
||||||
|
self.response = bottle:update(dt)
|
||||||
|
if self.response==nil then
|
||||||
|
self.response = tmp
|
||||||
|
else
|
||||||
|
self.responseTime = self.time
|
||||||
|
self.responseID = self.bottles[1].id
|
||||||
|
end
|
||||||
|
if not bottle.alive then
|
||||||
|
bottle:exitCallback(self.response)
|
||||||
|
table.remove(self.bottles,1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Ocean:draw()
|
||||||
|
if #self.bottles > 0 then
|
||||||
|
self.bottles[1]:draw()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Ocean:addBottle(bottle)
|
||||||
|
local bottles = self.bottles
|
||||||
|
table.insert(bottles, #bottles+1, bottle)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Message Bottle
|
||||||
|
This is a default message bottle class
|
||||||
|
Bottle background is drawn here.
|
||||||
|
--]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function MessageBottle:initialize(id, text)
|
||||||
|
super.initialize(self)
|
||||||
|
|
||||||
|
self.id = id or self.class.DEFAULT_ID
|
||||||
|
self.text = text or self.class.DEFAULT_TEXT
|
||||||
|
self.alive = true --Set to flag to mark for deletion
|
||||||
|
|
||||||
|
--Callbacks
|
||||||
|
self.enterCB = function() return end
|
||||||
|
self.exitCB = function(response) return end
|
||||||
|
|
||||||
|
--Sounds
|
||||||
|
self.sound = self.class.DEFAULT_SOUND
|
||||||
|
self.volume = self.class.DEFAULT_VOLUME
|
||||||
|
|
||||||
|
--Buttons
|
||||||
|
self.button = self.class.DEFAULT_BUTTON
|
||||||
|
self.buttonDown = false --Flag to make the button action happen on release
|
||||||
|
self.indicator = indicator or self.class.DEFAULT_INDICATOR
|
||||||
|
|
||||||
|
--Dimensions
|
||||||
|
self.x = self.class.DEFAULT_X
|
||||||
|
self.y = self.class.DEFAULT_Y
|
||||||
|
self.width = self.class.DEFAULT_WIDTH
|
||||||
|
self.height = self.class.DEFAULT_HEIGHT
|
||||||
|
|
||||||
|
--Foreground settings
|
||||||
|
self.fgColor = self.class.DEFAULT_FGCOLOR
|
||||||
|
self.fgAlpha = self.class.DEFAULT_FGALPHA
|
||||||
|
self.font = self.class.DEFAULT_FONT
|
||||||
|
self.align = self.class.DEFAULT_ALIGN
|
||||||
|
|
||||||
|
--Background settings
|
||||||
|
self.bgColor = self.class.DEFAULT_BGCOLOR
|
||||||
|
self.bgAlpha = self.class.DEFAULT_BGALPHA
|
||||||
|
self.bgRadius = self.class.DEFAULT_BGRADIUS
|
||||||
|
self.bgRadiusSegments = self.class.DEFAULT_RADIUSSEGMENTS
|
||||||
|
|
||||||
|
--Ease settings
|
||||||
|
self.easeTarget = self.class.DEFAULT_Y
|
||||||
|
self.easeOffset = self.class.DEFAULT_EASEOFFSET
|
||||||
|
self.easeTime = self.class.DEFAULT_EASETIME
|
||||||
|
|
||||||
|
--Fade settings
|
||||||
|
self.focusTime = 0 --seconds the message has been in focus
|
||||||
|
self.alpha = 0
|
||||||
|
self.fadeTime = self.class.DEFAULT_FADETIME
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:baseUpdate(dt, focusTime)
|
||||||
|
self.y = self:ease(focusTime,self.easeTime, self.easeTarget,self.easeOffset)
|
||||||
|
self.alpha = self:fade(focusTime,self.fadeTime, 0,255)
|
||||||
|
self.focusTime = self.focusTime + dt
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:enterCallback()
|
||||||
|
--Sound
|
||||||
|
self.source = love.audio.newSource(self.sound, "static")
|
||||||
|
self.source:setVolume(self.volume)
|
||||||
|
self.source:play()
|
||||||
|
self.enterCB()
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:exitCallback(response)
|
||||||
|
self.exitCB(response)
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:ease(t,d, a,b)
|
||||||
|
if d <= t then
|
||||||
|
function self:ease(t,d, a,b) return self.y end
|
||||||
|
end
|
||||||
|
local v = -(t/d)*(t/d-2)*b+a
|
||||||
|
return math.floor(v)
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:fade(t,d, a,b)
|
||||||
|
if d <= t then
|
||||||
|
function self:fade(t,d, a,b) return 255 end
|
||||||
|
end
|
||||||
|
local v = t/d*b+a
|
||||||
|
if v>=255 then
|
||||||
|
v=255
|
||||||
|
function self:fade(t,d, a,b) return 255 end
|
||||||
|
end
|
||||||
|
return v
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setX(x)
|
||||||
|
self.x = x
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setY(y)
|
||||||
|
self.easeTarget = y
|
||||||
|
self.y = y
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setPosition(x, y)
|
||||||
|
self.x = x
|
||||||
|
self.y = y
|
||||||
|
self.easeTarget = y
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setWidth(width)
|
||||||
|
self.width = width
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setHeight(height)
|
||||||
|
self.height = height
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setButton(button)
|
||||||
|
self.button = button
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setEase(ease)
|
||||||
|
self.ease = ease
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setEaseTime(easeTime)
|
||||||
|
self.easeTime = easeTime
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setFade(fade)
|
||||||
|
self.fade = fade
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setFadeTime(fadeTime)
|
||||||
|
self.fadeTime = fadeTime
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setEnterCallback(enterCB)
|
||||||
|
self.enterCB = enterCB
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setExitCallback(exitCB)
|
||||||
|
self.exitCB = exitCB
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setSound(sound)
|
||||||
|
if sound==nil then
|
||||||
|
self.volume = 0
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.sound = sound
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setVolume(volume)
|
||||||
|
self.volume = volume
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setIndicator(indicator)
|
||||||
|
self.indicator = love.graphics.newImage(indicator)
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setFgColor(r, g, b, a)
|
||||||
|
self.fgColor = {r, g, b, a}
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setFont(font, size)
|
||||||
|
self.font = love.graphics.newFont(font,size)
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setAlign(align)
|
||||||
|
self.align = align
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setBgColor(r, g, b, a)
|
||||||
|
self.bgColor = {r, g, b, a}
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setBgRadius(bgRadius)
|
||||||
|
self.bgRadius = bgRadius
|
||||||
|
end
|
||||||
|
|
||||||
|
function MessageBottle:setBgRadiusSegments(bgRadiusSegments)
|
||||||
|
self.bgRadiusSegments = bgRadiusSegments
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Staying Bottle
|
||||||
|
This pops up a message bottle and
|
||||||
|
goes away after a button is pressed
|
||||||
|
--]]
|
||||||
|
|
||||||
|
StayBottle = MessageBottle:subclass('StayBottle')
|
||||||
|
|
||||||
|
function StayBottle:initialize(id, text)
|
||||||
|
super.initialize(self, id, text)
|
||||||
|
end
|
||||||
|
|
||||||
|
function StayBottle:update(dt)
|
||||||
|
self:baseUpdate(dt,self.focusTime)
|
||||||
|
if love.keyboard.isDown(self.button) and self.buttonDown==false then
|
||||||
|
self.buttonDown = true
|
||||||
|
elseif self.buttonDown==true and not love.keyboard.isDown(self.button) then
|
||||||
|
self.alive = false
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function StayBottle:draw()
|
||||||
|
love.graphics.pushState()
|
||||||
|
self:drawBackground()
|
||||||
|
local color = self.fgColor
|
||||||
|
love.graphics.setColor(color.r,color.g,color.b,self.alpha)
|
||||||
|
love.graphics.setFont(self.font)
|
||||||
|
local text = ""
|
||||||
|
text = text..self.text..'\n'
|
||||||
|
local button = self.button
|
||||||
|
if button == " " then
|
||||||
|
button = "space"
|
||||||
|
end
|
||||||
|
if math.floor(self.focusTime)%2 == 0 then
|
||||||
|
text = text..'press \''..button..'\' to continue'
|
||||||
|
else
|
||||||
|
text = text..'press \''..button..'\' to continue...'
|
||||||
|
end
|
||||||
|
love.graphics.printf(text, self.x,self.y, self.width, self.align)
|
||||||
|
local floaty = math.sin(self.focusTime*3)*3
|
||||||
|
local y = self.y + self.height + floaty - self.indicator:getHeight()/2
|
||||||
|
love.graphics.draw(self.indicator,self.x+self.width/2, y)
|
||||||
|
love.graphics.popState()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Timed Bottle
|
||||||
|
This pops up a message bottle and
|
||||||
|
goes away after a set time duration
|
||||||
|
--]]
|
||||||
|
|
||||||
|
function TimeBottle:initialize(id, text, timeout)
|
||||||
|
super.initialize(self, id, text)
|
||||||
|
self.timeout = timeout or self.class.TIMEOUT
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimeBottle:update(dt)
|
||||||
|
self:baseUpdate(dt,self.focusTime)
|
||||||
|
self.timeout = self.timeout - dt
|
||||||
|
if love.keyboard.isDown(self.button) and self.buttonDown==false then
|
||||||
|
self.buttonDown = true
|
||||||
|
elseif self.buttonDown==true and not love.keyboard.isDown(self.button) then
|
||||||
|
self.alive = false
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
if self.timeout <= 0 then --count down a timer
|
||||||
|
self.alive = false
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimeBottle:draw()
|
||||||
|
love.graphics.pushState()
|
||||||
|
self:drawBackground()
|
||||||
|
local color = self.fgColor
|
||||||
|
love.graphics.setColor(color.r,color.g,color.b,self.alpha)
|
||||||
|
love.graphics.setFont(self.font)
|
||||||
|
love.graphics.printf(self.text, self.x,self.y, self.width, self.align)
|
||||||
|
love.graphics.popState()
|
||||||
|
end
|
||||||
|
|
||||||
|
function TimeBottle:setTimeout(timeout)
|
||||||
|
self.timeout = timeout
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Choice Bottle
|
||||||
|
This pops up a message with choices bottle
|
||||||
|
and goes away after a choice is made
|
||||||
|
--]]
|
||||||
|
|
||||||
|
ChoiceBottle = MessageBottle:subclass('ChoiceBottle')
|
||||||
|
|
||||||
|
function ChoiceBottle:initialize(id, text, ...)
|
||||||
|
super.initialize(self, id, text)
|
||||||
|
end
|
||||||
|
|
||||||
|
function ChoiceBottle:update(dt)
|
||||||
|
--Draw text and choices along with cursor
|
||||||
|
--Check keyboard / mouse input for selection
|
||||||
|
end
|
||||||
|
|
||||||
|
function ChoiceBottle:draw()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
+125
@@ -0,0 +1,125 @@
|
|||||||
|
-----------------------------------------------------------------------------------
|
||||||
|
-- MiddleClass.lua
|
||||||
|
-- Enrique García ( enrique.garcia.cota [AT] gmail [DOT] com ) - 19 Oct 2009
|
||||||
|
-- Based on YaciCode, from Julien Patte and LuaObject, from Sébastien Rocca-Serra
|
||||||
|
-----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local _classes = setmetatable({}, {__mode = "k"}) -- weak table storing references to all declared _classes and their included modules
|
||||||
|
|
||||||
|
Object = { name = "Object" } -- The 'Object' class
|
||||||
|
|
||||||
|
_classes[Object] = { modules={} } -- adds Object to the list of _classes
|
||||||
|
|
||||||
|
-- creates a new instance
|
||||||
|
Object.new = function(theClass, ...)
|
||||||
|
assert(_classes[theClass]~=nil, "Use class:new instead of class.new")
|
||||||
|
|
||||||
|
local instance = setmetatable({ class = theClass }, theClass.__classDict)
|
||||||
|
instance:initialize(...)
|
||||||
|
return instance
|
||||||
|
end
|
||||||
|
|
||||||
|
local _metamethods = { '__add', '__sub', '__mul', '__div', '__mod', '__pow', '__unm',
|
||||||
|
'__lt', '__le', '__call', '__gc', '__tostring', '__concat' }
|
||||||
|
|
||||||
|
-- creates a subclass
|
||||||
|
Object.subclass = function(theClass, name)
|
||||||
|
assert(_classes[theClass]~=nil, "Use class:subclass instead of class.subclass")
|
||||||
|
assert( type(name)=="string", "You must provide a name(string) for your class")
|
||||||
|
|
||||||
|
local theSubclass = { name = name, superclass = theClass, __classDict = {} }
|
||||||
|
local classDict = theSubclass.__classDict
|
||||||
|
|
||||||
|
-- classDict is the instances' metatable. It "points to himself" so they start looking for methods there.
|
||||||
|
classDict.__index = classDict
|
||||||
|
|
||||||
|
-- metamethods & methods are "looked up" through implementation and __index
|
||||||
|
for _,m in ipairs(_metamethods) do
|
||||||
|
classDict[m]= function(...)
|
||||||
|
assert( type(theClass.__classDict[m])=='function', "Class " .. theSubclass.name .. " does not implement the " .. m .. " metamethod")
|
||||||
|
return theClass.__classDict[m](...)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
setmetatable(classDict, {__index = theClass.__classDict})
|
||||||
|
|
||||||
|
-- control how the new methods are inserted on the subclass, and how they are looked up
|
||||||
|
setmetatable(theSubclass, {
|
||||||
|
__index = function(_,methodName)
|
||||||
|
-- search first on the subclass's classdict, then on the superclass
|
||||||
|
return classDict[methodName]~= nil and classDict[methodName] or theClass[methodName]
|
||||||
|
end,
|
||||||
|
__newindex = function(_, methodName, method) -- when adding new methods, include a "super" function
|
||||||
|
if type(method) == 'function' then
|
||||||
|
local fenv = getfenv(method)
|
||||||
|
local newenv = setmetatable( {super = theClass.__classDict}, {__index = fenv, __newindex = fenv} )
|
||||||
|
setfenv( method, newenv )
|
||||||
|
end
|
||||||
|
rawset(classDict, methodName, method)
|
||||||
|
end,
|
||||||
|
__tostring = function() return ("class ".. name) end,
|
||||||
|
__call = function(_, ...) return theSubclass:new(...) end
|
||||||
|
})
|
||||||
|
-- instance methods go after the setmetatable, so we can use "super"
|
||||||
|
theSubclass.initialize = function(instance,...) super.initialize(instance) end
|
||||||
|
|
||||||
|
_classes[theSubclass]={ modules={} } --registers the new class on the list of _classes
|
||||||
|
|
||||||
|
theClass:subclassed(theSubclass) -- hook method. By default it does nothing
|
||||||
|
|
||||||
|
return theSubclass
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Mixin extension function - simulates very basically ruby's include(module)
|
||||||
|
-- module is a lua table of functions. The functions will be copied to the class
|
||||||
|
-- if present in the module, the included() method will be called
|
||||||
|
Object.include = function(theClass, module, ... )
|
||||||
|
assert(_classes[theClass]~=nil, "Use class:includes instead of class.includes")
|
||||||
|
for methodName,method in pairs(module) do
|
||||||
|
if methodName ~="included" then theClass[methodName] = method end
|
||||||
|
end
|
||||||
|
if type(module.included)=="function" then module:included(theClass, ... ) end
|
||||||
|
_classes[theClass].modules[module] = true
|
||||||
|
return theClass
|
||||||
|
end
|
||||||
|
|
||||||
|
-- built-in methods
|
||||||
|
Object.__classDict = {
|
||||||
|
initialize = function(instance, ...) end, -- empty method
|
||||||
|
destroy = function(instance) end, -- empty method
|
||||||
|
__tostring = function(instance) return ("instance of ".. instance.class.name) end,
|
||||||
|
subclassed = function(theClass, other) end -- empty method
|
||||||
|
}
|
||||||
|
Object.__classDict.__index = Object.__classDict -- instances of Object need this
|
||||||
|
|
||||||
|
-- This allows doing tostring(obj) and Object() instead of Object:new()
|
||||||
|
setmetatable(Object, { __index = Object.__classDict, __newindex = Object.__classDict,
|
||||||
|
__tostring = function() return ("class Object") end,
|
||||||
|
__call = Object.new
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Returns true if aClass is a subclass of other, false otherwise
|
||||||
|
function subclassOf(other, aClass)
|
||||||
|
if _classes[aClass]==nil or _classes[other]==nil then return false end
|
||||||
|
if aClass.superclass==nil then return false end -- aClass is Object, or a non-class
|
||||||
|
return aClass.superclass == other or subclassOf(other, aClass.superclass)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns true if obj is an instance of aClass (or one of its subclasses) false otherwise
|
||||||
|
function instanceOf(aClass, obj)
|
||||||
|
if _classes[aClass]==nil or type(obj)~='table' or _classes[obj.class]==nil then return false end
|
||||||
|
if obj.class==aClass then return true end
|
||||||
|
return subclassOf(aClass, obj.class)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Returns true if the a module has already been included on a class (or a superclass of that class)
|
||||||
|
function includes(module, aClass)
|
||||||
|
if _classes[aClass]==nil or _classes[aClass].modules==nil then return false end
|
||||||
|
if _classes[aClass].modules[module] then return true end
|
||||||
|
return includes(module, aClass.superclass)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Creates a new class named 'name'. Uses Object if no baseClass is specified. Additional parameters for compatibility
|
||||||
|
function class(name, baseClass, ...)
|
||||||
|
baseClass = baseClass or Object
|
||||||
|
return baseClass:subclass(name, ...)
|
||||||
|
end
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 304 B |
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"welcome": "Debo tomar una decisión. No saldré de esta habitación hasta que tenga claro si mataré o dejaré vivir a mi novia. ¿Qué ha pasado en mi vida para que haya llegado hasta aquí? Tengo poco tiempo. Su vida se tambalea entre mis dedos.",
|
||||||
|
"cap1-preview": "Esta preciosa en esta foto. Mi madre me ha dado mucho más de lo que yo nunca podré devolverle. No solo me otorgó la vida, sino una razón para continuarla. Sus enseñanzas y duro caracteres me ha ayudado a ser el hombre que soy ahora. Lo que más deseo en este mundo es que se sienta orgulloso de mi. De mi trabajo y mi pareja. Pero una zorra lo estropeó todo.",
|
||||||
|
"cap1-stage": "Se meó en lo que yo más amaba. Me atacó en todo lo que mi madre me enseñó y mis más profundas creencias. No creo de forma poco clara, como mis hermanos, sino de verdad. Y esta niña no hizo más que ridiculizarme. Reírse delante de mis amigos. Llamarme loco en la intimidad. Tacharme de primitivo. Imbécil. Equivocado.... Pero la idiota es ella, la inmoral, la pecadora, la puta…. Necesito calmarme, relajar mi mente. Oír la palabra del Señor. Si salgo en este estado la voy a matar. Debo serenarme para pensar con claridad. ¡Señor, háblame!",
|
||||||
|
"cap2-stage": "Corintios 12:10 Por lo cual, por amor a Cristo me gozo en las debilidades, en afrentas, en necesidades, en persecuciones, en angustias; porque cuando soy débil, entonces soy fuerte. Igual de fuerte que me hizo ella. Se reía delante de mis amigos, pero para ayudarme a superar la timidez. Me llamaba loco para mejorar mis hábitos, para hacerme ver las manías que había aprendido de mi madre. Primitivo cuando no era tolerante con los demás. Y yo solo me enfadaba… como un imbécil. Una pequeña parte de mi alma le pertenece.
|
||||||
|
(Ve el marca-páginas): Pero no debo olvidar donde la conocí, donde alquilé sus primeros besos. Mis padres nunca deben saber la verdad. Mi madre no debe averiguar que humos aspiré, cuantas copas bebí esa noche. Debo destruir este papel. Nadie debe verlo.",
|
||||||
|
"cap3-stage": "Mientras el humo exploraba mis fosas nasales, recordé las barbacoas que hacíamos todos los sábados con mi familia. A ella la adoraban mis primos, y les caía muy bien a mis tíos. Mi padre siempre le hablaba sobre trucos de pesca, y mi madre la cuidaba como si fuera su propia hija. Estaba totalmente integrada a la familia. Por lo que la invitamos a venir a una barbacoa. Y entonces, mientras bendecíamos la mesa, ella se puso a comer. En el silencio se escuchó su boca mascando una grasienta salchicha. Todos la miraron sin aliento, y a continuación a mi con una mueca de indignación. No podía creer que estuviera sucediendo. La llevé a parte, a la cabaña de la leña. Lo que allí le dije no se borrará fácilmente de su memoria. Nunca conocí a una persona tan poco sensible… tan tan… y para disculparse nos regaló un jodido disco. ¿Piensa que puede comprarnos? Menuda mierda de regalo.",
|
||||||
|
"cap4-stage": "Me encanta esta canción. Ya recuerdo porque nos lo regaló. En el disco estaba nuestra canción. Una disculpa escondida a mi. Tal vez me alteré más de lo que tocaba. Después de todo ella no es religiosa, nunca había bendecido una mesa. Ni siquiera había visto cómo se realizaba. Hizo lo que cualquier otra persona hubiera hecho: sentarse y comer. Pobreta. No tuve que coger el disco, sus lágrimas eran más que suficientes. Nunca buscó hacer daño. Pero en cambio yo sí… ahora debo matarla. Lo tengo que hacer antes de que diga más mentiras sobre mi. Que manche mi imagen familiar. No lo puedo permitir. No soy gay. No estoy enfermo. No pienso usar esta llave. Saldré por la puerta y acabaré con ella. Se acabó los recuerdos, ya he tomado una decisión.",
|
||||||
|
"end-bad": "Muere puta",
|
||||||
|
"end-good": "Mi sujetador. Qué incómodo es. Siempre he odiado llevarlo, me hacen daño en los pechos. En nuestro primer aniversario secreto me regaló un conjunto. Me ha comprendido. Me ha ayudado siempre a crecer. A romper ataduras. Como la que me encuentro ahora. Decir a mi madre que soy una mujer que ama a otras… mujeres. Y que el Señor solo quiere que yo sea feliz. Tengo que ser fuerte. Corintios 12:10 Por lo cual, por amor a Cristo me gozo en las debilidades, en afrentas, en necesidades, en persecuciones, en angustias; porque cuando soy débil, entonces soy fuerte. Gracias mi amor."
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ local controls = require 'assets/scripts/controls'
|
|||||||
local bells = require 'assets/scripts/bells'
|
local bells = require 'assets/scripts/bells'
|
||||||
local camera = require 'assets/scripts/camera'
|
local camera = require 'assets/scripts/camera'
|
||||||
local stress = require 'assets/scripts/stress'
|
local stress = require 'assets/scripts/stress'
|
||||||
|
local messages = require 'assets/scripts/messages'
|
||||||
|
|
||||||
-- LOAD
|
-- LOAD
|
||||||
function love.load()
|
function love.load()
|
||||||
@@ -13,6 +14,7 @@ function love.load()
|
|||||||
stress.load(game, camera)
|
stress.load(game, camera)
|
||||||
bells.load(game, camera)
|
bells.load(game, camera)
|
||||||
controls.load(game)
|
controls.load(game)
|
||||||
|
messages.load(game)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- UPDATE
|
-- UPDATE
|
||||||
@@ -24,6 +26,7 @@ function love.update(dt)
|
|||||||
stress.update(dt, game, camera)
|
stress.update(dt, game, camera)
|
||||||
bells.update(dt, game, camera)
|
bells.update(dt, game, camera)
|
||||||
controls.update(dt, game, camera)
|
controls.update(dt, game, camera)
|
||||||
|
messages.update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- DRAW
|
-- DRAW
|
||||||
@@ -36,5 +39,6 @@ function love.draw()
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
controls.draw()
|
controls.draw()
|
||||||
|
messages.draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user