Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / Project.lua
Created February 14, 2015 13:52
Gists Codea Upload
--# EventMngr
-- ############## START of EVENT MANAGER ##################
-- <a href="/talk/profile/tnlogy">@tnlogy</a> &amp; <a href="/talk/profile/JMV38">@JMV38</a> &amp; <a href="/talk/profile/Briarfox">@Briarfox</a>
-- example of usage:
-- EventMngr:extend(evMngr) -- extend an existing table with event manager funcs
-- evMngr:on("touch",func) -- register func() to fire on "touch" event
-- evMngr:on("touch", obj.func, obj) -- register obj:func() to fire on "touch" event
-- evMngr:trigger("touch",10,50) -- fires func(10,50) and obj:func(10,50)
-- evMngr:off("touch", func) -- unregister func()
anonymous
anonymous / Project.lua
Created October 7, 2014 07:10
Gists Codea Upload
--# fft
-- fft
function realToCplx(iTable)
cplx = {}
for i,v in ipairs(iTable) do
cplx[i-1] = { r=v, i=0}
end
return cplx
anonymous
anonymous / Project.lua
Created August 31, 2014 06:10
Gists Codea Upload
--# Main
-- blendmode bench
displayMode(STANDARD)
function setup()
-- default colors
DST_background = color(0,0)
DST_foreground = color(255, 0, 0, 255)
SRC_background = color(0,0)
SRC_foreground = color(35, 0, 255, 255)
@NathanFlurry
NathanFlurry / ExampleCode.lua
Created May 24, 2014 18:10
You also need to have https://github.com/Zoyt/EasyiAP included in your project.
-- In setup
iapItems = {}
registerItem("itemIDOne")
registerItem("itemIDTwo")
initStore()
storeReady = false
purchasePending = false
-- Purchasing the item
purchaseItem(itemNum) -- Number of the item registered in order; i.e. 0 would be 'itemIDOne' and 1 would be 'itemIDTwo'