function love.load() cell_offset_x = 50 cell_offset_y = 50 cell_width = 29; cell_height = 24; --Load Actions require "actions.lua"; --Load Utilities require "utility.lua"; --Load Knowledge require "knowledge.lua"; load_knowledge(); --Graphics require "graphics.lua"; end function love.update(dt) function love.keypressed(key, unicode) if key == "left" then Move("Hero", {-1,0}); enemy_turn(); elseif key == "down" then Move("Hero", {0,1}); enemy_turn(); elseif key == "right" then Move("Hero", {1,0}); enemy_turn(); elseif key == "up" then Move("Hero", {0,-1}); enemy_turn(); end end end function enemy_turn() math.randomseed( os.time() ); for i,v in pairs(characters) do if not (characters[i].name == "Hero") then Move(characters[i].name, {math.random(-1,1), math.random(-1,1)}); end end end