mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-29 13:00:32 +01:00
e798e3a0be
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
373 lines
11 KiB
Diff
373 lines
11 KiB
Diff
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))
|