fix state thigns and port to love11
This commit is contained in:
parent
ff5abf6bcd
commit
c92c0f6ff7
11 changed files with 130 additions and 96 deletions
|
|
@ -156,7 +156,7 @@ function World:drawRoomPreview(name, x, y, size)
|
|||
love.graphics.setScissor(x, y, size, size)
|
||||
for _, object in ipairs(room.objects or {}) do
|
||||
if object.class == "npc" then
|
||||
love.graphics.setColor(255, 255, 255, 255)
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.print("?", x + (object.x - 1) * 16 * scale, y + (object.y - 1) * 16 * scale, 0, scale, scale)
|
||||
else
|
||||
local props = globalAssetProperties[object.class]
|
||||
|
|
@ -182,14 +182,14 @@ end
|
|||
|
||||
function World:draw()
|
||||
local cell = width / self.width
|
||||
love.graphics.setColor(12, 12, 20, 255)
|
||||
love.graphics.setColor(12 / 255, 12 / 255, 20 / 255, 1)
|
||||
love.graphics.rectangle("fill", 0, 0, width, height)
|
||||
for y = 1, self.height do
|
||||
for x = 1, self.width do
|
||||
local screenX, screenY = (x - 1) * cell, (y - 1) * cell
|
||||
local name = self:roomAt(x, y)
|
||||
if name then self:drawRoomPreview(name, screenX, screenY, cell) end
|
||||
love.graphics.setColor(name and 255 or 70, name and 255 or 70, name and 255 or 90, 255)
|
||||
love.graphics.setColor(name and 1 or 70 / 255, name and 1 or 70 / 255, name and 1 or 90 / 255, 1)
|
||||
love.graphics.rectangle("line", screenX, screenY, cell, cell)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue