-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprologuescene.lua
170 lines (133 loc) · 4.94 KB
/
prologuescene.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
local Timer = require 'libs/knife/knife/timer'
PrologueScene = Scene:extend()
function PrologueScene:new()
end
function PrologueScene:init()
-- Fonts
self.title_font = assets.fonts.hemi_head_bd_it(36)
self.text_font = assets.fonts.hemi_head_bd_it(36)
self.drawFunction = nil
self:startTimers()
end
function PrologueScene:update(dt)
Timer.update(dt)
end
function PrologueScene:draw()
if not (self.drawFunction == nil) then
self:drawFunction()
end
end
function PrologueScene:startTimers()
Timer.after(1, function() self.drawFunction = self.hideo end)
Timer.after(1, function() soundManager:play("thunder") end)
Timer.after(2, function() soundManager:play("rain") end)
Timer.after(4, function() self.drawFunction = self.not_hideo end)
Timer.after(7, function() self.drawFunction = self.place end)
Timer.after(9, function() self.drawFunction = self.place_and_time end)
Timer.after(12, function() self.drawFunction = self.history_1 end)
Timer.after(19, function() self.drawFunction = self.history_2 end)
Timer.after(26, function() self.drawFunction = self.history_3 end)
Timer.after(33, function() self.drawFunction = self.blank end)
Timer.after(36, function() self.drawFunction = self.history_4 end)
Timer.after(43, function() self.drawFunction = self.history_5 end)
Timer.after(50, function() self.drawFunction = self.history_6 end)
Timer.after(53, function() self:endScene() end)
end
function PrologueScene:hideo()
love.graphics.setFont(self.title_font)
love.graphics.setColor(255, 255, 255)
love.graphics.print("A HIDEO KOJIMA GAME", 1400, 800)
end
function PrologueScene:not_hideo()
love.graphics.setFont(self.title_font)
love.graphics.setColor(255, 255, 255)
love.graphics.print("NOT", 1320, 800)
love.graphics.print("A HIDEO KOJIMA GAME", 1400, 800)
end
function PrologueScene:place()
local text = "SÃO PAULO, BRASIL DO SUL"
local text_width = love.graphics.getFont():getWidth(text)
love.graphics.setFont(self.title_font)
love.graphics.setColor(255, 255, 255)
love.graphics.print(text,
(CONF_SCREEN_WIDTH - text_width)/2,
CONF_SCREEN_HEIGHT/2)
end
function PrologueScene:place_and_time()
self:place()
local text = "1 DE MAIO, 2077"
local text_width = love.graphics.getFont():getWidth(text)
love.graphics.setColor(255, 0, 0)
love.graphics.print(text,
(CONF_SCREEN_WIDTH - text_width)/2,
(CONF_SCREEN_HEIGHT/2) + 45)
end
function PrologueScene:history_1()
love.graphics.setFont(self.text_font)
love.graphics.setColor(1, 1, 1)
local text = "Após 16 anos de guerra de separação contra seus ex-compatriotas do norte,\no Brasil do Sul padece de graves problemas sociais."
love.graphics.print(text, 100, 200)
end
function PrologueScene:history_2()
self:history_1()
local text = "Com o decréscimo populacional, perda de mão-de-obra e\nmercado consumidor, o país enfrenta uma crise jamais vista."
love.graphics.print(text, 250, 400)
end
function PrologueScene:history_3()
self:history_2()
local text = {
{1,1,1}, "Buscando mão-de-obra barata, o presidente ",
{0,1,0}, "Enzo ",
{1,1,0}, "Bilnosliro",
{1,1,1}, ",\nneto do Duque, organiza minorias em campos de trabalho.\n\nÉ a SOLUÇÃO FINAL."
}
love.graphics.print(text, 400, 600)
end
function PrologueScene:blank()
end
function PrologueScene:history_4()
love.graphics.setFont(self.text_font)
love.graphics.setColor(1, 1, 1)
local text = {
{1,1,1}, "Com apoio clandestino da ",
{1,0,0}, "URSENE",
{1, 1, 1}, ", o quilombo Casa Verde\né um dos últimos focos de resistência."
}
love.graphics.print(text, 100, 300)
end
function PrologueScene:history_5()
self:history_4()
local text = "Após meses de guerrilha urbana, as autoridades \ntentam esmagar os rebeldes de uma vez por todas."
love.graphics.print(text, 250, 550)
end
function PrologueScene:history_6()
local text = "Hoje acontece o levante derradeiro."
local text_width = love.graphics.getFont():getWidth(text)
love.graphics.setFont(self.title_font)
love.graphics.setColor(255, 255, 255)
love.graphics.print(text,
(CONF_SCREEN_WIDTH - text_width)/2,
CONF_SCREEN_HEIGHT/2)
end
function PrologueScene:endScene()
sceneManager:setCurrent('game')
end
function PrologueScene:keyPressed(key, scancode, isRepeat)
end
function PrologueScene:keyReleased(key, scancode, isRepeat)
end
function PrologueScene:mousepressed(x, y, button, istouch, presses)
end
function PrologueScene:mousereleased(x, y, button, istouch, presses)
end
function PrologueScene:mousemoved(x, y, dx, dy, istouch)
end
function PrologueScene:wheelmoved(dx, dy)
end
function PrologueScene:gamepadpressed(joystick, button)
end
function PrologueScene:gamepadreleased(joystick, button)
end
function PrologueScene:gamepadaxis(joystick, axis, value)
end
return PrologueScene