From f394c1e293e0da77514e03441cf3867ff70f6fbc Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 9 Feb 2017 15:00:45 +0100 Subject: Fixed floating characters bug --- player.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/player.lua b/player.lua index b6d4e3f..6195da6 100644 --- a/player.lua +++ b/player.lua @@ -292,9 +292,11 @@ function Player:draw(offset_x, offset_y, scale, debug) local scale = scale or 1 local debug = debug or false local x, y = self:getPosition() - -- pixel grid + -- pixel grid ; `approx` selected to prevent floating characters on certain conditions + local approx = math.floor + if (y - math.floor(y)) > 0.5 then approx = math.ceil end + local draw_y = (approx(y) + offset_y) * scale local draw_x = (math.floor(x) + offset_x) * scale - local draw_y = (math.floor(y) + offset_y) * scale -- sprite draw Animated.draw(self, draw_x, draw_y, self.rotate, self.facing*scale, scale, 12, 15) -- debug draw -- cgit v1.1 From a0bb2b8e576751a3ca550dfc2a3236a0ac7b1270 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 9 Feb 2017 15:46:29 +0100 Subject: Tweaked Default Map platforms --- maps/default.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maps/default.lua b/maps/default.lua index 2ea17a6..05b8dc9 100644 --- a/maps/default.lua +++ b/maps/default.lua @@ -21,25 +21,25 @@ return { { x = -91, y = 0, - shape = {0,1, 181,1, 181,10, 96,76, 86,76, 0,10}, + shape = {0,1, 180,1, 180,10, 95,76, 86,76, 0,10}, sprite = "assets/platforms/default-big.png" }, { x = 114, y = 50, - shape = {0,1, 52,1, 52,30, 0,30}, + shape = {0,1, 51,1, 51,18, 0,18}, sprite = "assets/platforms/default-side.png" }, { x = -166, y = 50, - shape = {0,1, 52,1, 52,30, 0,30}, + shape = {0,1, 51,1, 51,18, 0,18}, sprite = "assets/platforms/default-side.png" }, { x = -17, y = -50, - shape = {0,1, 34,1, 34,16, 0,16}, + shape = {0,1, 33,1, 33,14, 0,14}, sprite = "assets/platforms/default-top.png" } }, -- cgit v1.1 From f6fec6e74b95d665998a8a08bfffb8a81d462cd3 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 9 Feb 2017 16:19:22 +0100 Subject: Rill platform shapes fixed --- maps/rill.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/maps/rill.lua b/maps/rill.lua index e150335..83c02f2 100644 --- a/maps/rill.lua +++ b/maps/rill.lua @@ -20,31 +20,31 @@ return { { x = -151, y = 25, - shape = {0,0, 56,0, 56,12, 0,12}, + shape = {0,0, 55,0, 55,11, 0,11}, sprite = "assets/platforms/rill-flat-left.png" }, { x = 93, y = 25, - shape = {0,0, 56,0, 56,12, 0,12}, + shape = {0,0, 55,0, 55,11, 0,11}, sprite = "assets/platforms/rill-flat-right.png" }, { x = -24, y = 55, - shape = {0,0, 49,0, 47,18, 3,18, 0,4}, + shape = {0,0, 48,0, 47,15, 1,15}, sprite = "assets/platforms/rill-center.png" }, { x = -112, y = 80, - shape = {78,30, 17,0, 0,0, 0,7, 78,45}, + shape = {77,30, 17,0, 0,0, 0,7, 77,44}, sprite = "assets/platforms/rill-slope-left.png" }, { x = 35, y = 80, - shape = {0,30, 61,0, 78,0, 78,7, 0,45}, + shape = {0,30, 60,0, 77,0, 77,7, 0,44}, sprite = "assets/platforms/rill-slope-right.png" } }, -- cgit v1.1 From 0a297ca570153ea07cf1eea76a33b2e56e5f14bc Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 9 Feb 2017 17:07:55 +0100 Subject: Fixed shapes of Ribbit's platforms --- maps/ribbit.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maps/ribbit.lua b/maps/ribbit.lua index 8b497b4..c3f5c78 100644 --- a/maps/ribbit.lua +++ b/maps/ribbit.lua @@ -32,13 +32,13 @@ return { { x = -70, y = -5, - shape = {0,3, 140,3, 132,26, 8,26}, + shape = {0,3, 139,3, 134,24, 5,24}, sprite = "assets/platforms/ribbit-top.png" }, { x = -54, y = 63, - shape = {0,3, 108,3, 84,41, 24,41}, + shape = {0,3, 107,3, 75,44, 32,44}, sprite = "assets/platforms/ribbit-bottom.png" } }, -- cgit v1.1 From b9bf644482bb68a94d19f9c052a204f54f963358 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 9 Feb 2017 17:48:45 +0100 Subject: Fixed Starstorm's platforms' shapes --- maps/starstorm.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/maps/starstorm.lua b/maps/starstorm.lua index 0540009..7f00633 100644 --- a/maps/starstorm.lua +++ b/maps/starstorm.lua @@ -23,42 +23,42 @@ return { x = -170, y = -55, shape = { - {0,1, 33,1, 39,6, 39,19, 31,21, 3,21}, - {40,6, 115,6, 114,14, 40,14} + {0,1, 33,1, 39,6, 39,21, 31,21, 0,21}, + {40,6, 115,6, 115,14, 40,14} }, sprite = "assets/platforms/starstorm-left-top.png" }, { x = -156, y = -2, - shape = {1,0, 109,0, 108,18, 1,20}, + shape = {0,0, 109,0, 109,20, 0,20}, sprite = "assets/platforms/starstorm-left-middle.png" }, { x = -160, y = 69, - shape = {0,4, 17,1, 97,1, 102,6, 102,11, 97,16, 19,16, 1,11}, + shape = {0,4, 8,4, 13,1, 102,1, 102,16, 19,16, 0,11}, sprite = "assets/platforms/starstorm-left-bottom.png" }, { x = 52, y = -55, shape = { - {116,1, 83,1, 77,6, 77,19, 85,21, 113,21}, - {76,6, 1,6, 2,14, 76,14} + {115,1, 82,1, 76,6, 76,21, 84,21, 115,21}, + {75,6, 0,6, 0,14, 75,14} }, sprite = "assets/platforms/starstorm-right-top.png" }, { x = 44, y = -2, - shape = {109,0, 1,0, 2,18, 109,20}, + shape = {109,0, 0,0, 0,20, 109,20}, sprite = "assets/platforms/starstorm-right-middle.png" }, { x = 55, y = 69, - shape = {103,4, 86,1, 6,1, 1,6, 1,11, 6,16, 84,16, 102,11}, + shape = {102,4, 94,4, 89,1, 0,1, 0,16, 83,16, 102,11}, sprite = "assets/platforms/starstorm-right-bottom.png" }, { -- cgit v1.1 From c4cec4731cdf10ac2740775c08efbda571e58040 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 9 Feb 2017 17:51:06 +0100 Subject: Selector avoid randomizing random --- selector.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selector.lua b/selector.lua index 851e451..61401e7 100644 --- a/selector.lua +++ b/selector.lua @@ -284,7 +284,7 @@ function Selector:controlpressed(set, action, key) if action == "attack" then local name = self:getListValue(self:getSelection(n)) if name == "random" then - self:setSelection(n, self:rollRandom({1})) -- avoid empty naut + self:setSelection(n, self:rollRandom({1,2})) -- avoid empty naut self.locks[n] = true else -- If not empty or if first is allowed. Additionaly must be unique selection. -- cgit v1.1