ca0e8212
Geoffrey PREUD'HOMME
Code original
|
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
|
prevt = 0
to = 0
totimes = {8.55, 8.8, 9.4, 9.5, 9.7, 11.0, 12.3, 12.9, 13.2}
end
function scene6_update(dt)
playeranimationtimer = playeranimationtimer + dt
while playeranimationtimer > 0.1 do
playeranimationtimer = playeranimationtimer - 0.1
playerquad = playerquad + 1
if playerquad == 3 then
playerquad = 1
elseif playerquad == 5 then
playerquad = 3
end
end
for i, v in pairs(bigexplosions) do
v:update(dt)
end
if starttimer >= 0.7 and starttimer - dt < 0.7 then
bigexplosionsound:play()
end
if starttimer < 0.2 then
elseif starttimer < 0.5 then
fade = 1
if #explosions == 0 then
table.insert(bigexplosions, bigexplosion:new(-4, -30))
table.insert(bigexplosions, bigexplosion:new(-40, -30))
table.insert(bigexplosions, bigexplosion:new(36, -30))
table.insert(bigexplosions, bigexplosion:new(-4, -50))
end
elseif starttimer < 4 then
if fade > 0.5 then
fade = fade - dt/2
end
else
if fade > 0 then
fade = fade - dt/2
end
end
if starttimer > 8.3 and starttimer - dt < 8.3 then
credits:play()
end
if shakeamount > 0 then
shakeamount = shakeamount - dt*3
end
for i = 1, 9 do
if starttimer > totimes[i] then
to = i
end
end
|
ca0e8212
Geoffrey PREUD'HOMME
Code original
|
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
|
end
function scene6_draw()
local r, g, b = love.graphics.getColor()
for i = 1, backgroundstripes, 1 do
if math.mod(i, 2) == 1 then
love.graphics.setColor(255, 255, 0, math.min(1, math.max(0, 1-(starttimer-7)/2))*255)
else
love.graphics.setColor(255, 0, 0, math.min(1, math.max(0, 1-(starttimer-7)/2))*255)
end
local pos = {31, 53}
local alpha = math.rad((i/backgroundstripes + math.mod(sunrot/100, 1)) * 360)
local point1 = {pos[1]*scale+200*scale*math.cos(alpha), pos[2]*scale+200*scale*math.sin(alpha)}
local alpha = math.rad(((i+1)/backgroundstripes + math.mod(sunrot/100, 1)) * 360)
local point2 = {pos[1]*scale+200*scale*math.cos(alpha), pos[2]*scale+200*scale*math.sin(alpha)}
love.graphics.polygon("fill", pos[1]*scale, pos[2]*scale, point1[1], point1[2], point2[1], point2[2])
end
love.graphics.setColor(r, g, b, 255)
for i,v in pairs(stars) do
v:draw()
v:draw()
v:draw()
v:draw()
end
love.graphics.translate(20*scale, 50*scale)
love.graphics.rotate(math.pi/7)
love.graphics.translate(-20*scale, -50*scale)
for i, v in pairs(bigexplosions) do
v:draw()
end
draw(groundwinimg, -168-landdiff, 56)
love.graphics.drawq(winplayerimg, winplayerquad[playerquad], 30*scale, 55*scale, 0, scale, scale, 5, 13)
love.graphics.translate(20*scale, 50*scale)
love.graphics.rotate(-math.pi/7)
love.graphics.translate(-20*scale, -50*scale)
for i = 1, math.min(9, to) do
local s = scale/2
if i >= 8 then
s = s * 2
love.graphics.setColor(getrainbowcolor(math.random()))
end
if i == 9 then
draw(titleimg, 65, 65, 0, 0.7, 0.7, 50, 14)
else
properprint(texts[i], 50-tostring(texts[i]):len()*s/2, 5*i, s)
end
love.graphics.setColor(255, 255, 255)
end
|