View astar.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local module = {} | |
local INF = 1/0 | |
function dist ( x1, y1, x2, y2 ) | |
return math.sqrt ( math.pow ( x2 - x1, 2 ) + math.pow ( y2 - y1, 2 ) ) | |
end | |
function heuristic_cost_estimate ( nodeA, nodeB ) | |
return dist ( nodeA.x, nodeA.y, nodeB.x, nodeB.y ) * 2000 |
View DeltaCompression.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local DeltaTable ={ | |
--[[ | |
This module is for getting the difference between a table and then | |
being able to merge it back in. | |
-- Specifically great for networking as it allows us only to send what has changed | |
This is an independant Module because it has enough parts to it, that it should be | |
seperated from ADTs and or some sort of "Table" lib. This is abstractly a table differ. | |
--]] | |
_VERSION = 2.0 |
View DetailModule.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- A lightweight module for hiding "detail" objects that get too far away from the camera | |
-- | |
-- Usage: | |
-- Tag objects with Detail_Small and Detail_Big | |
-- If they get too far from the camera, they get parented to nil | |
-- (Tries to account for the objects getting deleted or parented around by other processes, results may vary!) | |
-- | |
-- MCR, 2021 | |