Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	game/scene.lua
  • Loading branch information
Julien Olsson authored and Julien Olsson committed May 18, 2019
2 parents 8462b6c + 80f3cad commit a5efde2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 5 deletions.
Binary file added assets/sprites/text_insid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprites/text_txt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions editor/scene.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function scene.getTransform()
return transform
end

last_hovered_tile = {0,0}
function scene.draw(dt)
love.graphics.setBackgroundColor(0.10, 0.1, 0.11)

Expand Down Expand Up @@ -150,6 +151,12 @@ function scene.draw(dt)

love.graphics.setColor(1, 1, 0)
love.graphics.rectangle("line", hx * TILE_SIZE, hy * TILE_SIZE, TILE_SIZE, TILE_SIZE)

last_hovered_tile = {hx, hy}
end

if selector_open then
love.graphics.print(last_hovered_tile[1] .. ', ' .. last_hovered_tile[2], 0, roomheight)
end

love.graphics.pop()
Expand Down
14 changes: 13 additions & 1 deletion game/scene.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ local scene = {}
function scene.load()
repeat_timers = {}
selector_open = false
game_started = false

clear()
love.mouse.setCursor(empty_cursor)
resetMusic("bab_be_u_them", 0.5)
loadMap()
parseRules()
updateUnits(true)

game_started = true
end

function scene.update(dt)
Expand All @@ -23,7 +26,7 @@ function scene.update(dt)
cursors[i].y = cursors[i].y + mouse_Y - mouse_oldY
end

if cursor_convert_to ~= nil then
if game_started and cursor_convert_to ~= nil then
for i,mous in ipairs(cursors) do
local hx,hy = screenToGameTile(cursors[i].x, cursors[i].y)
if hx ~= nil and hy ~= nil then
Expand Down Expand Up @@ -99,6 +102,15 @@ function scene.draw(dt)
if unit.type == "text" and not unit.active then
brightness = 0.33
end

if unit.fullname == "text_gay" then
if unit.active then
unit.sprite = "text_gay-colored"
else
unit.sprite = "text_gay"
end
end

local drawx = lerp(unit.oldx, unit.x, unit.move_timer/MAX_MOVE_TIMER)
local drawy = lerp(unit.oldy, unit.y, unit.move_timer/MAX_MOVE_TIMER)

Expand Down
4 changes: 3 additions & 1 deletion game/undo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ function newUndo()
end

function addUndo(data)
table.insert(undo_buffer[1], 1, data)
if #undo_buffer > 0 then
table.insert(undo_buffer[1], 1, data)
end
end

function undo()
Expand Down
4 changes: 2 additions & 2 deletions game/unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ function updateUnits(undoing)
local istext = false
if rule[3] == "text" then
istext = true
obj_name = "text_" .. unit.name
obj_name = "text_" .. rule[1]
end
local obj_id = tiles_by_name[rule[3]]
local obj_id = tiles_by_name[obj_name]
local obj_tile = tiles_list[obj_id]

if units_by_name[rule[1]] then
Expand Down
11 changes: 10 additions & 1 deletion values.lua
Original file line number Diff line number Diff line change
Expand Up @@ -437,5 +437,14 @@ tiles_list = {
grid = {5, 7},
color = {115,115,115},
layer = 20
}
},
--41
{
name = "text_text",
sprite = "text_txt",
type = "text",
grid = {6, 2},
color = {217,57,106},
layer = 20,
},
}

0 comments on commit a5efde2

Please # to comment.