Skip to content

Instantly share code, notes, and snippets.

View Bri-G's full-sized avatar
🏠
I may be slow to respond.

Bri-G Bri-G

🏠
I may be slow to respond.
View GitHub Profile
@Bri-G
Bri-G / Bouncer.lua
Created March 12, 2012 17:29
ball in a box
-- Use this function to perform your initial setup
function setup()
    
    displayMode(FULLSCREEN)
    boxheight = 50
    boxwidth = 50
    ballX = 400
    ballY = 400
@Bri-G
Bri-G / BallInBox.lua
Created March 14, 2012 12:53
Ball in a box
-- Use this function to perform your initial setup
function setup()
displayMode(FULLSCREEN)
boxheight =3D 50
boxwidth =3D 50
ballX =3D 400
ballY =3D 400
ballZ =3D 74
updown =3D -4
@Bri-G
Bri-G / SphereRotation.lua
Created March 14, 2012 12:55
Rotation of a sphere
-- Sphere rotation program
-- main.lua first
-- Use this function to perform your initial setup
function setup()
-- displayMode(FULLSCREEN)
ballX =3D 300
ballY =3D 300
@Bri-G
Bri-G / gist:2823293
Created May 29, 2012 08:23
Nodules
-- A converted javascript (by Keith Peters) adapted for Codea by Bri_G
-- ref. http://www.bit-101.com/blog/?p=3214
-- excellent description given note - retained background used
function setup()
-- system and variable initialisations
displayMode(FULLSCREEN)
backingMode(RETAINED)
wide = WIDTH
high = HEIGHT
@Bri-G
Bri-G / buttons3.lua
Created May 30, 2012 07:52
Rounded Buttons
-- Main
function setup()
saveProjectInfo("Description", "Cornered buttons demo")
saveProjectInfo("Version", "1.003 beta")
saveProjectInfo("Author", "Bri_G")
-- set up the function call parameters to play with the buttons
-- all self explanatory except cr which is the curvature control
-- note parameter range affects output, distortions are possible
parameter("cr",0,1,1)
iparameter("border",0,4,0)
@Bri-G
Bri-G / textSphere.lua
Created May 30, 2012 12:29
Text genertion of a sphere
-- code from http://rosettacode.org/wiki/Draw_a_sphere
-- tickled slightly for Codea by Bri_G
-- various authors under GNU Free Documentation Licence 1.2
-- http://www.gnu.org/licenses/fdl-1.2.html
-- Use this function to perform your initial setup
saveProjectInfo("Description", "Text Sphere")
saveProjectInfo("Version", "1.001 beta")
saveProjectInfo("Author", "Bri_G")
@Bri-G
Bri-G / snow.lua
Created May 30, 2012 12:32
Text Snowman
-- Use this function to perform your initial setup
function setup()
saveProjectInfo("Description", "Flash Screen")
saveProjectInfo("Version", "1.001 beta")
saveProjectInfo("Author", "Bri_G")
print(string.char(0xe2,0x98,0x83))
snow = string.char(0xe2,0x98,0x83)
displayMode(FULLSCREEN)
-- iparameter("posX",40,100,60)
@Bri-G
Bri-G / particles.lua
Created June 1, 2012 11:52
particles
-- A converted javascript (by Keith Peters) adapted for Codea by Bri_G
-- ref. http://www.bit-101.com/blog/?p=3148
-- excellent description given
-- Use this function to perform your initial setup
function setup()
-- initialisations of system and variables used
displayMode(FULLSCREEN)
points = {x={}, y={}, z={}, vx={}, vy={}, size={}, colr={}}
numPoints = 50
@Bri-G
Bri-G / particles1.lua
Created June 1, 2012 11:54
particles from emitter
-- A converted javascript (by Keith Peters) adapted for Codea by Bri_G
-- ref. http://www.bit-101.com/blog/?p=3150
-- excellent description given
-- Use this function to perform your initial setup
function setup()
-- initialisations of system and variables used
displayMode(FULLSCREEN)
numPoints = 300
gravity = 0.1
@Bri-G
Bri-G / PSphere.lua
Created June 7, 2012 19:12
Old School rotating sphere
-- A translation of the javascript from Guido D'Albore by Bri_G
-- reference http://www.bitstorm.it/blog/en/2011/05/3d-sphere-html5-canvas/
-- with help from Inviso and Andrew Stacey on the mechanics
-- set up for Love2D too - remove the comment marks
--[[ if require ~= nil then
require("loveCodea")
require("Polar")
end --]]
function setup()