Skip to content

Commit

Permalink
Merge pull request #72 from HugoBDesigner/love2d-11.1
Browse files Browse the repository at this point in the history
Löve2D 11.1 Support
  • Loading branch information
HugoBDesigner authored Aug 29, 2018
2 parents 6f16ce6 + e81ad90 commit 2318e8e
Show file tree
Hide file tree
Showing 70 changed files with 1,292 additions and 1,020 deletions.
2 changes: 1 addition & 1 deletion actionblock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function actionblock:draw()
if self.state == "on" then
q = 2
end
love.graphics.drawq(actionblockimg, wallindicatorquad[q], math.floor((self.x-xscroll)*16*scale), math.floor((self.y-.5-yscroll-bounceyoffset)*16*scale), 0, scale, scale)
love.graphics.draw(actionblockimg, wallindicatorquad[q], math.floor((self.x-xscroll)*16*scale), math.floor((self.y-.5-yscroll-bounceyoffset)*16*scale), 0, scale, scale)
end

function actionblock:floorcollide(a, b, c, d)
Expand Down
2 changes: 1 addition & 1 deletion andgate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ end

function andgate:draw()
if self.visible then
love.graphics.setColor(255, 255, 255)
love.graphics.setColor(1, 1, 1)
love.graphics.draw(andgateimg, math.floor((self.x-1-xscroll)*16*scale), ((self.y-yscroll-1)*16-8)*scale, 0, scale, scale)
end
end
Expand Down
2 changes: 1 addition & 1 deletion animation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function animation:update(dt)
elseif v[1] == "addpoints" then
addpoints(tonumber(v[2]) or 1)
elseif v[1] == "changebackgroundcolor" then
love.graphics.setBackgroundColor(tonumber(v[2]) or 255, tonumber(v[3]) or 255, tonumber(v[4]) or 255)
love.graphics.setBackgroundColor(tonumber(v[2]) / 255 or 1, tonumber(v[3]) / 255 or 1, tonumber(v[4]) / 255 or 1)
elseif v[1] == "killplayer" then
if v[2] == "everyone" then
for i = 1, players do
Expand Down
10 changes: 5 additions & 5 deletions animationguiline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -838,13 +838,13 @@ function animationguiline:init(tabl, t2)
local firstwidth = 22--#animationstrings[self.type][start]

self.deletebutton = guielement:new("button", 0, 0, "x", function() self:delete() end, nil, nil, nil, 8, 0.1)
self.deletebutton.textcolor = {200, 0, 0}
self.deletebutton.textcolor = {0.6, 0, 0}

self.downbutton = guielement:new("button", 0, 0, "_dir6", function() self:movedown() end, nil, nil, nil, 8, 0.1)
self.downbutton.textcolor = {255, 255, 255}
self.downbutton.textcolor = {1, 1, 1}

self.upbutton = guielement:new("button", 0, 0, "_dir4", function() self:moveup() end, nil, nil, nil, 8, 0.1)
self.upbutton.textcolor = {255, 255, 255}
self.upbutton.textcolor = {1, 1, 1}

self.elements[1].gui = guielement:new("dropdown", 0, 0, firstwidth, function(val) self:changemainthing(val) end, start, unpack(animationstrings[self.type]))
self.elements[1].width = 14+firstwidth*8
Expand Down Expand Up @@ -950,7 +950,7 @@ end
function animationguiline:draw(x, y)
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("fill", x*scale, y*scale, (width*16-x)*scale, 11*scale)
love.graphics.setColor(255, 255, 255)
love.graphics.setColor(1, 1, 1)

local xadd = 0
self.deletebutton.x = x+xadd
Expand All @@ -970,7 +970,7 @@ function animationguiline:draw(x, y)

for i = 1, #self.elements do
if self.elements[i].t == "text" then
love.graphics.setColor(255, 255, 255)
love.graphics.setColor(1, 1, 1)
properprint(self.elements[i].value, (x+xadd-1)*scale, (y+2)*scale)
xadd = xadd + self.elements[i].width
else
Expand Down
2 changes: 1 addition & 1 deletion blockdebris.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ function blockdebris:update(dt)
end

function blockdebris:draw()
love.graphics.drawq(blockdebrisimg, blockdebrisquads[spriteset][self.frame], math.floor((self.x-xscroll)*16*scale), math.floor((self.y-yscroll-.5)*16*scale), 0, scale, scale, 4, 4)
love.graphics.draw(blockdebrisimg, blockdebrisquads[spriteset][self.frame], math.floor((self.x-xscroll)*16*scale), math.floor((self.y-yscroll-.5)*16*scale), 0, scale, scale, 4, 4)
end
2 changes: 1 addition & 1 deletion bowser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function bowser:draw()
--just for the hammers
if not self.fall and not self.backwards then
if self.hammertimer > self.hammertime - bowserhammerdrawtime then
love.graphics.drawq(enemiesdata["hammer"].graphic, enemiesdata["hammer"].quad, math.floor((self.x-xscroll)*16*scale), (self.y-yscroll-.5-11/16)*16*scale, 0, scale, scale)
love.graphics.draw(enemiesdata["hammer"].graphic, enemiesdata["hammer"].quad, math.floor((self.x-xscroll)*16*scale), (self.y-yscroll-.5-11/16)*16*scale, 0, scale, scale)
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ function button:draw()
end

if self.dir == "down" then
love.graphics.drawq(buttonimg, buttonquad[quad], math.floor((self.x-1/16-xscroll)*16*scale), ((self.y-yscroll)*16-10)*scale, 0, scale, scale)
love.graphics.draw(buttonimg, buttonquad[quad], math.floor((self.x-1/16-xscroll)*16*scale), ((self.y-yscroll)*16-10)*scale, 0, scale, scale)
elseif self.dir == "left" then
love.graphics.drawq(buttonimg, buttonquad[quad], math.floor((self.x+4/16-xscroll)*16*scale), ((self.y-yscroll)*16-21)*scale, math.pi/2, scale, scale)
love.graphics.draw(buttonimg, buttonquad[quad], math.floor((self.x+4/16-xscroll)*16*scale), ((self.y-yscroll)*16-21)*scale, math.pi/2, scale, scale)
elseif self.dir == "right" then
love.graphics.drawq(buttonimg, buttonquad[quad], math.floor((self.x+10/16-xscroll)*16*scale), ((self.y-yscroll)*16+11)*scale, -math.pi/2, scale, scale)
love.graphics.draw(buttonimg, buttonquad[quad], math.floor((self.x+10/16-xscroll)*16*scale), ((self.y-yscroll)*16+11)*scale, -math.pi/2, scale, scale)
elseif self.dir == "up" then
love.graphics.drawq(buttonimg, buttonquad[quad], math.floor((self.x+31/16-xscroll)*16*scale), ((self.y-yscroll)*16-16)*scale, math.pi, scale, scale)
love.graphics.draw(buttonimg, buttonquad[quad], math.floor((self.x+31/16-xscroll)*16*scale), ((self.y-yscroll)*16-16)*scale, math.pi, scale, scale)
end
end

Expand Down
24 changes: 17 additions & 7 deletions characterloader.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function loadcharacter(charname)
local folder = "characters/" .. charname .. "/"
if not love.filesystem.exists(folder .. "config.txt") then
if not love.filesystem.getInfo(folder .. "config.txt") then
return false
end

Expand All @@ -12,6 +12,16 @@ function loadcharacter(charname)

local char = JSON:decode(s)
char.name = (char.name and string.lower(char.name)) or string.lower(charname)

if char.defaultcolors then
for i, colors in ipairs(char.defaultcolors) do
for j, color in ipairs (colors) do
for k = 1, 3 do
char.defaultcolors[i][j][k] = char.defaultcolors[i][j][k] / 255
end
end
end
end

-----------------
--IMAGE LOADING--
Expand All @@ -28,10 +38,10 @@ function loadcharacter(charname)
curtype = "nogunbiganimations"
end

if char.defaultcolors and love.filesystem.exists(folder .. curtype .. "1.png") then --MULTIPLE IMAGES
if char.defaultcolors and love.filesystem.getInfo(folder .. curtype .. "1.png") then --MULTIPLE IMAGES
local imagecount = #char.defaultcolors[1]
for i = 1, imagecount do
if not love.filesystem.exists(folder .. curtype .. i .. ".png") then
if not love.filesystem.getInfo(folder .. curtype .. i .. ".png") then
if t <= 2 then
return false
else
Expand All @@ -45,16 +55,16 @@ function loadcharacter(charname)
end

--0 Image
if love.filesystem.exists(folder .. curtype .. "0.png") then
if love.filesystem.getInfo(folder .. curtype .. "0.png") then
char[curtype][0] = love.graphics.newImage(folder .. curtype .. "0.png")
end

--Dot Image
if love.filesystem.exists(folder .. curtype .. "dot.png") then
if love.filesystem.getInfo(folder .. curtype .. "dot.png") then
char[curtype]["dot"] = love.graphics.newImage(folder .. curtype .. "dot.png")
end
else
if love.filesystem.exists(folder .. curtype .. ".png") then
if love.filesystem.getInfo(folder .. curtype .. ".png") then
char[curtype] = love.graphics.newImage(folder .. curtype .. ".png")
end
end
Expand Down Expand Up @@ -165,7 +175,7 @@ end
characterlist = {}
characters = {}
for i, v in pairs(love.filesystem.getDirectoryItems("characters/")) do
if (love.filesystem.isDirectory("characters/" .. v)) then
if love.filesystem.getInfo("characters/" .. v, "directory") then
local temp = loadcharacter(v)
if temp then
characters[v] = temp
Expand Down
4 changes: 1 addition & 3 deletions conf.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
function love.conf(t)
t.title = "Mari0 SE"
t.title = "Mari0: Community Edition"
t.author = "Maurice"
t.identity = "mari0_se"
t.modules.physics = false
t.release = false
t.window = false
t.console = true
end
2 changes: 1 addition & 1 deletion customhats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function loadhat(path)
return
end

if not love.filesystem.exists("hats/" .. s1[7] .. ".png") or not love.filesystem.exists("hats/" .. s1[8] .. ".png") then
if not love.filesystem.getInfo("hats/" .. s1[7] .. ".png") or not love.filesystem.getInfo("hats/" .. s1[8] .. ".png") then
return
end

Expand Down
2 changes: 1 addition & 1 deletion delayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ end

function delayer:draw()
if self.visible then
love.graphics.setColor(255, 255, 255)
love.graphics.setColor(1, 1, 1)
love.graphics.draw(delayerimg, math.floor((self.x-1-xscroll)*16*scale), ((self.y-yscroll-1)*16-8)*scale, 0, scale, scale)
end
end
Expand Down
12 changes: 6 additions & 6 deletions dialogbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function dialogbox:init(text, speaker)
--take out that string
self.text = string.sub(self.text, 1, i-1) .. string.sub(self.text, j+1)
else
self.textcolors[i] = {tonumber(curcolor[1]), tonumber(curcolor[2]), tonumber(curcolor[3])}
self.textcolors[i] = {tonumber(curcolor[1]) / COLORCONVERT, tonumber(curcolor[2]) / COLORCONVERT, tonumber(curcolor[3]) / COLORCONVERT}
i = i + 1
end
end
Expand All @@ -51,9 +51,9 @@ function dialogbox:draw()
local boxheight = 45
local margin = 4
local lineheight = 10
love.graphics.setColor(0, 0, 0, 127)
love.graphics.setColor(0, 0, 0, 0.5)
love.graphics.rectangle("fill", scale*margin, (height*16-boxheight-margin)*scale, (width*16-margin*2)*scale, boxheight*scale)
love.graphics.setColor(255, 255, 255)
love.graphics.setColor(1, 1, 1)
drawrectangle(5, (height*16-margin-boxheight+1), (width*16-margin*2-2), boxheight-2)

local availablepixelsx = width*16-margin*2-6
Expand All @@ -76,13 +76,13 @@ function dialogbox:draw()
end

if self.speaker then
love.graphics.setColor(0, 0, 0, 127)
love.graphics.setColor(0, 0, 0, 0.5)
love.graphics.rectangle("fill", scale*margin, (height*16-boxheight-margin-10)*scale, (5+#self.speaker*8)*scale, 10*scale)

--love.graphics.setColor(255, 255, 255)
--love.graphics.setColor(1, 1, 1)
--drawrectangle(5, (height*16-margin-boxheight+1-10), (3+#self.speaker*8), 11)

love.graphics.setColor(self.color or {232, 130, 30})
love.graphics.setColor(self.color or {232/255, 130/255, 30/255})
properprint(self.speaker, (margin+2)*scale, (height*16-margin-boxheight+1-9)*scale)
end
end
Loading

0 comments on commit 2318e8e

Please sign in to comment.