Skip to content

Instantly share code, notes, and snippets.

View linwaiwai's full-sized avatar

linwaiwai linwaiwai

  • FizzGate
  • Guangzhou
View GitHub Profile
/*
What this function does:
Rasterizes a single Field Of View octant on a grid, similar to the way
FOV / shadowcasting is implemented in some roguelikes.
Clips to bitmap
What it DOES NOT do:
Subpixel accuracy
Antialiasing
@linwaiwai
linwaiwai / extern.lua
Last active August 29, 2015 14:02
Modify extern.lua copied from cocos-2dx to support new function with params
function clone(object)
local lookup_table = {}
local function _copy(object)
if type(object) ~= "table" then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table