From 937f24699ce35a0c42b67c0fa8c1de8b9947b6a0 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 16 Jul 2016 05:13:47 +0200 Subject: Sprites color keying and new sprites --- assets/biker.png | Bin 1702 -> 2209 bytes assets/bison.png | Bin 1696 -> 1804 bytes assets/boss.png | Bin 0 -> 2126 bytes assets/bug.png | Bin 0 -> 2023 bytes assets/calamari.png | Bin 1137 -> 11193 bytes assets/capone.png | Bin 0 -> 1988 bytes assets/gelato.png | Bin 2158 -> 2601 bytes assets/girl.png | Bin 1948 -> 2178 bytes assets/gorilla.png | Bin 0 -> 1892 bytes assets/gramps.png | Bin 0 -> 2199 bytes assets/gummybear.png | Bin 0 -> 2072 bytes assets/lady.png | Bin 1948 -> 1912 bytes assets/link.png | Bin 0 -> 2290 bytes assets/marine.png | Bin 1945 -> 2267 bytes assets/nemo.png | Bin 0 -> 2519 bytes assets/phonebooth.png | Bin 0 -> 2608 bytes assets/rock.png | Bin 0 -> 2762 bytes assets/scissors.png | Bin 2062 -> 2086 bytes assets/scooter.png | Bin 0 -> 2083 bytes assets/veno.png | Bin 2242 -> 2305 bytes assets/vrooom.png | Bin 0 -> 3314 bytes assets/weed.png | Bin 2090 -> 2088 bytes main.lua | 16 ++++++++++++++++ nautslist.lua | 18 +++++++++--------- player.lua | 3 ++- 25 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 assets/boss.png create mode 100644 assets/bug.png create mode 100644 assets/capone.png create mode 100644 assets/gorilla.png create mode 100644 assets/gramps.png create mode 100644 assets/gummybear.png create mode 100644 assets/link.png create mode 100644 assets/nemo.png create mode 100644 assets/phonebooth.png create mode 100644 assets/rock.png create mode 100644 assets/scooter.png create mode 100644 assets/vrooom.png diff --git a/assets/biker.png b/assets/biker.png index 91d7b6e..4737a99 100644 Binary files a/assets/biker.png and b/assets/biker.png differ diff --git a/assets/bison.png b/assets/bison.png index 55b32fa..6c9dfc4 100644 Binary files a/assets/bison.png and b/assets/bison.png differ diff --git a/assets/boss.png b/assets/boss.png new file mode 100644 index 0000000..bed5b91 Binary files /dev/null and b/assets/boss.png differ diff --git a/assets/bug.png b/assets/bug.png new file mode 100644 index 0000000..04961f7 Binary files /dev/null and b/assets/bug.png differ diff --git a/assets/calamari.png b/assets/calamari.png index 3b3e1c9..6918325 100644 Binary files a/assets/calamari.png and b/assets/calamari.png differ diff --git a/assets/capone.png b/assets/capone.png new file mode 100644 index 0000000..50dbdac Binary files /dev/null and b/assets/capone.png differ diff --git a/assets/gelato.png b/assets/gelato.png index 8d66684..761f3e1 100644 Binary files a/assets/gelato.png and b/assets/gelato.png differ diff --git a/assets/girl.png b/assets/girl.png index 5c5ad47..b393513 100644 Binary files a/assets/girl.png and b/assets/girl.png differ diff --git a/assets/gorilla.png b/assets/gorilla.png new file mode 100644 index 0000000..c4f1b20 Binary files /dev/null and b/assets/gorilla.png differ diff --git a/assets/gramps.png b/assets/gramps.png new file mode 100644 index 0000000..975c1be Binary files /dev/null and b/assets/gramps.png differ diff --git a/assets/gummybear.png b/assets/gummybear.png new file mode 100644 index 0000000..0abacac Binary files /dev/null and b/assets/gummybear.png differ diff --git a/assets/lady.png b/assets/lady.png index 14c5ab4..654f2ed 100644 Binary files a/assets/lady.png and b/assets/lady.png differ diff --git a/assets/link.png b/assets/link.png new file mode 100644 index 0000000..f8cadd8 Binary files /dev/null and b/assets/link.png differ diff --git a/assets/marine.png b/assets/marine.png index d6310c8..ab388ac 100644 Binary files a/assets/marine.png and b/assets/marine.png differ diff --git a/assets/nemo.png b/assets/nemo.png new file mode 100644 index 0000000..06c3540 Binary files /dev/null and b/assets/nemo.png differ diff --git a/assets/phonebooth.png b/assets/phonebooth.png new file mode 100644 index 0000000..c9cace5 Binary files /dev/null and b/assets/phonebooth.png differ diff --git a/assets/rock.png b/assets/rock.png new file mode 100644 index 0000000..d6e2156 Binary files /dev/null and b/assets/rock.png differ diff --git a/assets/scissors.png b/assets/scissors.png index 623a381..37ed9f7 100644 Binary files a/assets/scissors.png and b/assets/scissors.png differ diff --git a/assets/scooter.png b/assets/scooter.png new file mode 100644 index 0000000..e179b35 Binary files /dev/null and b/assets/scooter.png differ diff --git a/assets/veno.png b/assets/veno.png index 9ba8d84..3504e21 100644 Binary files a/assets/veno.png and b/assets/veno.png differ diff --git a/assets/vrooom.png b/assets/vrooom.png new file mode 100644 index 0000000..0244322 Binary files /dev/null and b/assets/vrooom.png differ diff --git a/assets/weed.png b/assets/weed.png index b1ff68f..9dc0e37 100644 Binary files a/assets/weed.png and b/assets/weed.png differ diff --git a/main.lua b/main.lua index 9be9eda..aa24c08 100644 --- a/main.lua +++ b/main.lua @@ -2,17 +2,33 @@ -- WHOLE CODE HAS FLAG OF "need a cleanup" -- Pretend you didn't see this +-- This is work for scene manager Scene = nil function changeScene(scene) Scene = scene end +-- Should be moved to scene/camera function getScale() return math.max(1, math.floor(love.graphics.getWidth() / 320)-1, math.floor(love.graphics.getHeight() / 180)-1) end function getRealScale() return math.max(love.graphics.getWidth() / 320, love.graphics.getHeight() / 180) end +-- Should be moved anywhere; engine object +function newImage(path) + local imagedata = love.image.newImageData(path) + local transparency = function(x, y, r, g, b, a) + if (r == 0 and g == 128 and b == 64) or + (r == 0 and g == 240 and b == 6) then + a = 0 + end + return r, g, b, a + end + imagedata:mapPixel(transparency) + local image = love.graphics.newImage(imagedata) + return image +end -- Require require "world" diff --git a/nautslist.lua b/nautslist.lua index b81b327..d28b9ab 100644 --- a/nautslist.lua +++ b/nautslist.lua @@ -14,19 +14,19 @@ return { "bison", -- skolldir "bobito", -- yuri "slugzor", -- derpl - --"capone", -- vinnie - --"nemo", -- spike - --"bug", -- genji + "capone", -- vinnie + "nemo", -- spike + "bug", -- genji "calamari", -- swiggins --"quack", -- rocco "scissors", -- ksenia "marine", -- ted - --"scooter", -- penny - --"phonebooth", -- sentry + "scooter", -- penny + "phonebooth", -- sentry "weed", -- skree - --"gummybear", -- nibbs - --"gramps", -- yoolip + "gummybear", -- nibbs + "gramps", -- yoolip "biker", -- chucho - --"vrooom", -- lux - --"link" -- ix + "vrooom", -- lux + "link", -- ix } diff --git a/player.lua b/player.lua index 2a5d270..f22bff8 100644 --- a/player.lua +++ b/player.lua @@ -63,7 +63,7 @@ function Player:new (game, world, x, y, name) o.body:setFixedRotation(true) -- Misc o.name = name or "empty" - o.sprite = love.graphics.newImage("assets/"..o.name..".png") + o.sprite = newImage("assets/"..o.name..".png") o.world = game -- Animation o.initial = o.delay @@ -82,6 +82,7 @@ function Player:delete() self.sprite = nil end +-- Controller function Player:assignController(controller) self.controller = controller or nil controller:setParent(self) -- cgit v1.1