Browse Source

fix more serialization bugs

master
Nicholas Hayashi 4 years ago
parent
commit
2ebd971b8c
  1. 2
      main.lua
  2. 4
      src/game.lua

2
main.lua

@ -169,7 +169,7 @@ function main_scene(do_backdrop)
local node = am.translate(hex_to_pixel(vec2(i, j), vec2(HEX_SIZE))) local node = am.translate(hex_to_pixel(vec2(i, j), vec2(HEX_SIZE)))
^ am.circle(vec2(0), HEX_SIZE, vec4(0), 6) ^ am.circle(vec2(0), HEX_SIZE, vec4(0), 6)
node"circle":action(am.tween(1, { color = color }))
node"circle":action(am.tween(0.6, { color = color }))
hex_backdrop:append(node) hex_backdrop:append(node)
end end

4
src/game.lua

@ -140,6 +140,10 @@ local function game_deserialize(json_string)
end end
end end
-- after we have re-constituted all of the towers and modified the map's elevations accordingly,
-- we should re-calc the flow-field
apply_flow_field(new_state.map, generate_flow_field(new_state.map, HEX_GRID_CENTER), new_state.world)
for i,m in pairs(new_state.mobs) do for i,m in pairs(new_state.mobs) do
if m then if m then
new_state.mobs[i] = mob_deserialize(m) new_state.mobs[i] = mob_deserialize(m)

Loading…
Cancel
Save