-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcredits.lua
More file actions
189 lines (156 loc) · 4.67 KB
/
Copy pathcredits.lua
File metadata and controls
189 lines (156 loc) · 4.67 KB
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
-- Story cutscene/sequence.
require 'TESound.TEsound'
local Timer = require "hump.timer"
local Camera = require "hump.camera"
local font = love.graphics.setNewFont(28)
Gamestate.credits = Gamestate.new()
local state = Gamestate.credits
local currentString = ""
local currentStringNum = 0
local diagInterval = 5
local dialogue = {
"Action Movie: The Series (The Video Game)",
"Conceived and Conceptualized by Christy and Francisco",
"Writing and Acting by Christy and Francisco",
"Digital Manipulations by Christy and Francisco",
"Visuals and Art Direction by Christy",
"Funky Jams Performed by Francisco",
"Cinematography by Francisco",
"Costume Design by Christy",
"THE END"
}
local currentShot = 0
local shotFuncs = {
function() state:startingShot() end,
function() state:startingShot() end,
function() state:startingShot() end,
function() state:startingShot() end,
function() state:startingShot() end,
function() state:startingShot() end,
function() state:startingShot() end,
function() state:startingShot() end,
function() state:startingShot()
stringTimer.clear()
end,
}
function state:enter()
love.graphics.setFont(font)
-- musics
bgMusicList = {"music/actionCredits.ogg"}
-- start music
TEsound.play(bgMusicList, "stream")
-- background
backgroundScene = love.graphics.newImage("art/cityscape.png")
-- players
player1:setPosition(Vector(400,500))
player2:setPosition(Vector(470,500))
player2.facing = Vector(-1,0)
player2.frameFlipH = -1
murderballer = Murderballer()
murderballer.position = Vector(445, 518)
-- timer stuff
stringTimer = Timer.new()
-- state.camera setup
-- set up state.camera ------------------------------------
state.cam = Camera(
player1.position.x + 50,
player1.position.y,
10, -- zoom level
0 -- rotation angle
)
state.camdx = 0 -- state.camera x panning rate
state.camdy = 0
state.camdz = 1
-- string stuff
currentStringNum = 0
-- init state.camera and diag here
state:nextLine()
end
function state:nextLine()
stringTimer:clear()
currentStringNum = currentStringNum + 1
currentString = dialogue[currentStringNum]
stringTimer:add(diagInterval, function()
if currentStringNum >= table.getn(dialogue) then
-- Gamestate.switch(Gamestate.menu)
else
state:nextLine()
state:nextShot() -- no shot changes here
end
end)
end
function state:nextShot()
currentShot = currentShot + 1
if currentShot <= table.getn(shotFuncs) then
shot = shotFuncs[currentShot]
shot()
end
end
function state:update(dt)
-- trying this frame limiter here
frameLimiter(dt)
globalMenuBGx = globalMenuBGx + dt * globalMenuBGdx
if ( globalMenuBGx < -1*titleScene:getWidth()) then
globalMenuBGx = 0
end
dt = math.min(dt, 1/60)
stringTimer:update(dt)
-- player1:update(dt)
-- player2:update(dt)
-- state.cam:move(state.camdx*dt,state.camdy*dt)
-- state.cam:zoom(state.camdz)
-- murderballer:update(dt)
end
function state:draw()
-- state.cam:attach()
love.graphics.draw(titleScene, globalMenuBGx,0)
love.graphics.draw(titleScene, globalMenuBGx + titleScene:getWidth(), 0)
-- draw stuff that's state.camera locked here
-- player1:draw()
-- player2:draw()
-- murderballer:draw()
-- state.cam:detach()
-- cinematic letterboxing here
love.graphics.setColor(255,0,0,255)
-- love.graphics.rectangle("fill", 0, 0, dimScreen.x, 150)
-- love.graphics.rectangle("fill", 0, dimScreen.y - 150, dimScreen.x, 150)
love.graphics.printf( currentString, (dimScreen.x/2) - 400, (dimScreen.y/2)-150, 800, "center" )
love.graphics.setColor(255,255,255,255)
end
function state:leave()
stringTimer:clear()
TEsound.stop("stream", false) -- stop bg music immediately
end
function state:keyreleased(key)
if key == "escape" then
-- quits to menu
Gamestate.switch(Gamestate.menu)
elseif key == " " or key=="return" then
-- (space) skips to main scene1
Gamestate.switch(Gamestate.menu)
elseif key == player1.keyfire or key == player2.keyfire then
-- skip to next line in diag
if currentStringNum >= table.getn(dialogue) then
Gamestate.switch(Gamestate.menu)
else
state:nextLine()
-- state:nextShot()
end
end
end
function state:startingShot()
state.cam:lookAt(600,400)
state.cam:zoomTo(1)
end
function state:closeUp(p)
state.cam:lookAt(p.position.x + 25, p.position.y + 15)
state.cam:zoomTo(16)
end
function state:shot2()
state.cam:lookAt(player2.position.x + 30, player2.position.y+30)
state.cam:zoomTo(12)
end
function state:bothPlayers()
state.cam:lookAt(player1.position.x + 60, player1.position.y+30)
state.cam:zoomTo(8)
end