Skip to content

Instantly share code, notes, and snippets.

View geekhunger's full-sized avatar

geekhunger geekhunger

View GitHub Profile
@geekhunger
geekhunger / main.lua
Created January 17, 2015 16:11
Codea deviceShaking() function
-- Accelometer Shake
supportedOrientations(LANDSCAPE_RIGHT)
function setup()
print("Shake a few times until the rect() exceeds the ellipse().")
end
local function deviceShaking()
local acceleration = UserAcceleration
@geekhunger
geekhunger / PixelboyUndoRedoSnippets.lua
Last active August 29, 2015 14:11
Full Source Of Pixelboy
--# Main
-------------------------------------------------------------- NAMESPACES
local Touches = {}
local Frames = {}
local CurrentFrame = 0
local Action = {}
local Actions, CurrentAction = {}
@geekhunger
geekhunger / Color.lua
Last active August 29, 2015 14:06
Simplified Painting App, made with Codea.
--# Color
-- modified version from https://github.com/EmmanuelOga/columns/blob/master/utils/color.lua
--[[
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
@geekhunger
geekhunger / Hook.lua
Last active April 15, 2016 14:20
Easy Backups in Codea.
--# Hook
local s_setup
debug.sethook(function(event)
if setup and setup ~= s_setup then
local o_setup = setup
setup = function()
debug.sethook()
if hook then hook() end
o_setup()
end