aboutsummaryrefslogtreecommitdiff
path: root/games/mrrescue/20180818_a5be73c.diff
blob: 958b288c725c04d605fb527b95a10ebb63b95b10 (plain)
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
diff --git a/conf.lua b/conf.lua
index db46228..41d3cbf 100644
--- a/conf.lua
+++ b/conf.lua
@@ -1,33 +1,14 @@
 function love.conf(t)
     t.identity = "mrrescue"
-    t.version = "0.10.0"
-    t.console = false
-
-    t.window.title = "Mr. Rescue"
-    t.window.icon = nil
-    t.window.width = 256*3
-    t.window.height = 200*3
-    t.window.borderless = false
-    t.window.resizable = false
-    t.window.fullscreen = false
-    t.window.fullscreentype = "exclusive"
-    t.window.vsync = true
-    t.window.fsaa = 0
-    t.window.display = 1
-    t.window.highdpi = false
-    t.window.srgb = false
-
-    t.modules.physics = false
-    t.modules.mouse = false
-end
-
-function love.conf(t)
-    t.identity = "mrrescue"
-    t.version = "0.10.0"
+    t.appendidentity = false
+    t.version = "11.0"
     t.console = false
     t.accelerometerjoystick = true
+    t.externalstorage = false
     t.gammacorrect = false
- 
+
+    t.audio.mixwithsystem = true
+
     t.window.title = "Mr. Rescue"
     t.window.icon = nil
     t.window.width = 256*3
@@ -38,15 +19,17 @@ function love.conf(t)
     t.window.minheight = 1
     t.window.fullscreen = false
     t.window.fullscreentype = "desktop"
-    t.window.vsync = true
+    t.window.vsync = 1
     t.window.msaa = 0
     t.window.display = 1
     t.window.highdpi = false
     t.window.x = nil
     t.window.y = nil
- 
+
     t.modules.audio = true
+    t.modules.data = true
     t.modules.event = true
+    t.modules.font = true
     t.modules.graphics = true
     t.modules.image = true
     t.modules.joystick = true
diff --git a/config.lua b/config.lua
index 63eeb04..71c2b66 100644
--- a/config.lua
+++ b/config.lua
@@ -38,7 +38,7 @@ function loadConfig()
 			config[i] = v
 		end
 	end
-	if love.filesystem.exists("settings") then
+	if love.filesystem.getInfo("settings")~= nil then
 		local data = love.filesystem.read("settings")
 		local file = TSerial.unpack(data)
 		for i,v in pairs(file) do
@@ -52,7 +52,7 @@ function loadConfig()
 end
 
 function loadHighscores()
-	if love.filesystem.exists("highscores") then
+	if love.filesystem.getInfo("highscores")~= nil then
 		local data = love.filesystem.read("highscores")
 		local file = TSerial.unpack(data)
 		for i=1,3 do
@@ -64,7 +64,7 @@ function loadHighscores()
 end
 
 function loadStats()
-	if love.filesystem.exists("stats") then
+	if love.filesystem.getInfo("stats")~= nil then
 		local data = love.filesystem.read("stats")
 		stats = TSerial.unpack(data)
 	end
diff --git a/highscore_entry.lua b/highscore_entry.lua
index 2f763af..3b3bb73 100644
--- a/highscore_entry.lua
+++ b/highscore_entry.lua
@@ -45,9 +45,9 @@ function highscore_entry.draw()
 		for ix = 1,10 do
 			if highscore_entry.selection == char then
 				lg.rectangle("fill", 33+ix*16, 66+iy*16, 14, 14)
-				lg.setColor(0,0,0,255)
+				lg.setColor(0,0,0,1)
 				lg.print(KEYBOARD:sub(char,char), 37+ix*16, 70+iy*16)
-				lg.setColor(255,255,255,255)
+				lg.setColor(1,1,1,1)
 			else
 				lg.print(KEYBOARD:sub(char,char), 37+ix*16, 70+iy*16)
 			end
diff --git a/highscore_list.lua b/highscore_list.lua
index 6a17973..b66d0e2 100644
--- a/highscore_list.lua
+++ b/highscore_list.lua
@@ -31,10 +31,10 @@ function highscore_list.draw()
 		if scores[i] then
 			if highscore_list.level == highscore_list.hllevel
 			and highscore_list.hlpos == i then
-				lg.setColor(25,118,115,255)
+				lg.setColor(25/255,118/255,115/255,1)
 				lg.print(scores[i].name,   48, 14+i*16)
 				lg.print(scores[i].score, 105, 14+i*16)
-				lg.setColor(255,255,255,255)
+				lg.setColor(1,1,1,1)
 			else
 				lg.print(scores[i].name,   48, 14+i*16)
 				lg.print(scores[i].score, 105, 14+i*16)
diff --git a/ingame.lua b/ingame.lua
index 52004f1..4fcfcfe 100644
--- a/ingame.lua
+++ b/ingame.lua
@@ -189,16 +189,16 @@ function ingame.draw()
 		lg.pop()
 
 		if map.type == MT_NORMAL then
-			lg.setBlendMode("multiply")
+			lg.setBlendMode("multiply", "premultiplied")
 			lg.draw(canvas, 0,0)
 			lg.setBlendMode("alpha")
 		end
 
 		-- Draw red screen if hit
 		if player.heat > 0 then
-			lg.setColor(255,255,255,cap(player.heat*255, 16, 255))
+			lg.setColor(1,1,1,cap(player.heat, 0.063, 1))
 			lg.draw(img.red_screen, quad.red_screen, 0,0)
-			lg.setColor(255,255,255,255)
+			lg.setColor(1,1,1,1)
 		end
 
 		-- Draw hud
@@ -249,13 +249,13 @@ end
  
 function drawWonMessage()
 	local alpha = cap((-translate_y)/100, 0, 1)
-	lg.setColor(0,0,0,alpha*255)
+	lg.setColor(0,0,0,alpha)
 	lg.rectangle("fill", 0, 40, WIDTH, #WON_MESSAGES[level]*10+12)
-	lg.setColor(255,255,255,alpha*255)
+	lg.setColor(1,1,1,alpha)
 	for i,v in ipairs(WON_MESSAGES[level]) do
 		lg.printf(v, 0, 48+(i-1)*10, WIDTH, "center")
 	end
-	lg.setColor(255,255,255,255)
+	lg.setColor(1,1,1,1)
 end
 
 function drawHUD()
@@ -296,13 +296,13 @@ function drawHUD()
 	if player:isDying() then
 		local color = 0
 		if warning_frame <= 1 then
-			color = 30 + warning_frame * 225
+			color = 0.118 + warning_frame
 		else
-			color = 255 - (warning_frame % 1)*225
+			color = 1 - (warning_frame % 1)
 		end
-		lg.setColor(255,color,color)
+		lg.setColor(1,color,color)
 		lg.draw(img.temperature_bar_blink, 74, HEIGHT-26)
-		lg.setColor(255,255,255)
+		lg.setColor(1,1,1)
 	end
 
 	-- Draw item slots
@@ -320,11 +320,11 @@ function drawHUD()
 
 	-- Draw score
 	lg.setFont(font.bold)
-	lg.setColor(16,12,9)
+	lg.setColor(16/255,12/255,9/255)
 	lg.print("SCORE: "..score,150,187)
-	lg.setColor(246,247,221)
+	lg.setColor(246/255,247/255,221/255)
 	lg.print("SCORE: "..score,150,186)
-	lg.setColor(255,255,255)
+	lg.setColor(1,1,1)
 
 	-- Draw boss health bar
 	if map.type == MT_BOSS and ingame_state ~= INGAME_WON then
diff --git a/ingame_menu.lua b/ingame_menu.lua
index 9fcf768..82a8459 100644
--- a/ingame_menu.lua
+++ b/ingame_menu.lua
@@ -18,10 +18,10 @@ function ingame_menu.draw()
 	lg.pop()
 
 	lg.scale(config.scale)
-	lg.setColor(0,0,0,238)
+	lg.setColor(0,0,0,238/255)
 	lg.rectangle("fill", 0, 0, WIDTH, HEIGHT)
 
-	lg.setColor(255,255,255,255)
+	lg.setColor(1,1,1,1)
 	lg.printf("PAUSED", 0, 46, WIDTH, "center")
 	lg.print("RESUME", 103, 92)
 	lg.print("QUIT", 103, 106)
diff --git a/joystick.lua b/joystick.lua
index 50ccadb..72d545e 100644
--- a/joystick.lua
+++ b/joystick.lua
@@ -22,11 +22,11 @@ function joystick.draw()
 	lg.printf("SET JOYSTICK", 0, 39, WIDTH, "center")
 	for i=1,4 do
 		if joystick.waiting == true and joystick.selection == i then
-			lg.setColor(195,52,41)
+			lg.setColor(195/255,52/255,41/255)
 		end
 		lg.print(string.upper(joykeynames[i]), 65, 53+i*13)
 		lg.print(config.joykeys[joykeynames[i]], 165, 53+i*13)
-		lg.setColor(255,255,255)
+		lg.setColor(1,1,1)
 	end
 	lg.print("DEFAULT", 65, 118)
 	lg.print("BACK", 65, 131)
diff --git a/keyboard.lua b/keyboard.lua
index 5cada98..a4d0db8 100644
--- a/keyboard.lua
+++ b/keyboard.lua
@@ -22,19 +22,19 @@ function keyboard.draw()
 	lg.printf("SET KEYBOARD", 0, 26, WIDTH, "center")
 	for i,v in ipairs(keynames) do
 		if keyboard.waiting == true and i == keyboard.selection then
-			lg.setColor(195,52,41)
+			lg.setColor(195/255,52/255,41/255)
 		end
 		lg.print(string.upper(v), 65, 40+i*13)
 		if config.keys[v] == " " then
 			lg.print("SPACE", 154, 40+i*13)
 		elseif config.keys[v] == "none" then
-			lg.setColor(118,31,25)
+			lg.setColor(118/255,31/255,25/255)
 			lg.print("NONE", 154, 40+i*13)
-			lg.setColor(255,255,255)
+			lg.setColor(1,1,1)
 		else
 			lg.print(string.upper(config.keys[v]:sub(1,7)), 154, 40+i*13)
 		end
-		lg.setColor(255,255,255)
+		lg.setColor(1,1,1)
 	end
 	lg.print("DEFAULT", 65, 144)
 	lg.print("BACK", 65, 157)
diff --git a/main.lua b/main.lua
index 9433e42..56096fa 100644
--- a/main.lua
+++ b/main.lua
@@ -273,7 +273,7 @@ function love.releaseerrhand(msg)
     local font = love.graphics.newFont(14)
     love.graphics.setFont(font)
 
-    love.graphics.setColor(255, 255, 255, 255)
+    love.graphics.setColor(1, 1, 1, 1)
 
     love.graphics.clear()
 
diff --git a/resources.lua b/resources.lua
index e5aa70d..1bab520 100644
--- a/resources.lua
+++ b/resources.lua
@@ -7,7 +7,7 @@ local snd = {}	-- sound Sources
 
 local IMAGE_FILES = {
 	"splash", "tangram", "lovesplashpixel", "howto",
-	"tiles", "door", "boldfont", "captain_dialog", "captain_dialog_sad",
+	"tiles", "door", "captain_dialog", "captain_dialog_sad",
 	"boss_health", "highscore_panes", "exclamation", "stats_screen",
 	"awards", "hud", "hud2", "hud_people", "item_slots", "water_bar",
 	"reserve_bar", "overloaded_bar", "temperature_bar", "temperature_bar_blink",
@@ -147,7 +147,7 @@ function loadResources()
 	img.stream:setWrap("repeat", "clamp")
 
 	-- Create fonts
-	font.bold = lg.newImageFont(img.boldfont, " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!'-:*@<>+/_$&?", 2)
+	font.bold = lg.newImageFont("data/boldfont.png", " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!'-:*@<>+/_$&?", 2)
 	lg.setFont(font.bold)
 
 	-- Create quads
diff --git a/splash.lua b/splash.lua
index 6c779cd..0ef225b 100644
--- a/splash.lua
+++ b/splash.lua
@@ -19,37 +19,37 @@ function splash.draw()
 
 	if transition_time < 4 then
 		if transition_time < 1 then
-			local alpha = cap(255*transition_time, 0,255)
-			lg.setColor(255,255,255,alpha)
+			local alpha = cap(transition_time, 0, 1)
+			lg.setColor(1,1,1,alpha)
 			lg.draw(img.tangram, quad.screen, 0,0)
-			lg.setColor(255,255,255,255)
+			lg.setColor(1,1,1,1)
 		elseif transition_time > 3 then
-			local alpha = cap(255*(1-(transition_time-3)), 0,255)
-			lg.setColor(255,255,255,alpha)
+			local alpha = cap(1-(transition_time-3), 0, 1)
+			lg.setColor(1,1,1,alpha)
 			lg.draw(img.tangram, quad.screen, 0,0)
-			lg.setColor(255,255,255,255)
+			lg.setColor(1,1,1,1)
 		else
 			lg.draw(img.tangram, quad.screen, 0,0)
 		end
 	elseif transition_time < 8 then
 		if transition_time < 5 then
-			local alpha = cap(255*(transition_time-4), 0,255)
-			lg.setColor(255,255,255,alpha)
+			local alpha = cap(transition_time-4, 0, 1)
+			lg.setColor(1,1,1,alpha)
 			lg.draw(img.lovesplashpixel, quad.screen, 0,0)
-			lg.setColor(255,255,255,255)
+			lg.setColor(1,1,1,1)
 		elseif transition_time > 7 then
-			local alpha = cap(255*(1-(transition_time-7)), 0,255)
-			lg.setColor(255,255,255,alpha)
+			local alpha = cap(1-(transition_time-7), 0, 1)
+			lg.setColor(1,1,1,alpha)
 			lg.draw(img.lovesplashpixel, quad.screen, 0,0)
-			lg.setColor(255,255,255,255)
+			lg.setColor(1,1,1,1)
 		else
 			lg.draw(img.lovesplashpixel, quad.screen, 0,0)
 		end
 	elseif transition_time < 10 then
-		local alpha = cap(128*(transition_time-8), 0, 255)
-		lg.setColor(255,255,255,alpha)
+		local alpha = cap(0.5*(transition_time-8), 0, 1)
+		lg.setColor(1,1,1,alpha)
 		lg.draw(img.splash, quad.screen, 0,0)
-		lg.setColor(255,255,255,255)
+		lg.setColor(1,1,1,1)
 	else
 		lg.draw(img.splash, quad.screen, 0,0)
 		lg.setFont(font.bold)
diff --git a/util.lua b/util.lua
index b9976da..656600a 100644
--- a/util.lua
+++ b/util.lua
@@ -105,9 +105,9 @@ end
 
 
 function drawBox(x,y,w,h)
-	lg.setColor(30,23,18)
+	lg.setColor(30/255,23/255,18/255)
 	lg.rectangle("fill",x+1,y+1,w-2,h-2)
-	lg.setColor(255,255,255)
+	lg.setColor(1,1,1)
 	-- Draw sides
 	lg.draw(img.menu_box, quad.box_left, x, y+1, 0, 1, (h-2))
 	lg.draw(img.menu_box, quad.box_left, x+w, y+1, 0, -1, (h-2))