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
There's a bug in the "Gravity" example for Codify (as of Oct 27, 2011) - the arrowhead doesn't point the right direction in the upper left quadrant. | |
To fix: | |
Change line 34 to: | |
down = vec2(1,0) | |
And change lines 44-45 to: |
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
watch("t") | |
watch("r") | |
watch("s") | |
watch("aa") | |
-- Use this function to perform your initial setup | |
function setup() | |
origin = vec2(1,0) | |
w2 = WIDTH/2 | |
h2 = HEIGHT/2 |
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
#!/usr/bin/perl | |
$img = shift @ARGV; | |
$corner = `convert $img -format '%[pixel:s.p{0,0}]' info:`; | |
chomp $corner; | |
print "corner color is $corner\n"; | |
@r = split(/\./, $img); | |
$ext = pop @r; | |
$name = join('.', @r); $name = $name . "_new." . $ext; | |
print "Saving to $name\n"; |
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
function drawchar(c, ox, oy) | |
ax=-1 | |
ay=-1 | |
bx=-1 | |
by=-1 | |
stroke(255,0,21,255) | |
strokewidth(3) | |
ch = font[c] | |
for p=1, ch.points do | |
ax=bx |
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
-- Use this function to perform your initial setup | |
function setup() | |
fontinfo={} | |
fontinfo["#"] = { points=11, width=21, ascii=35, | |
data={ 11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6 } } | |
end | |
-- This function gets called once every frame | |
function draw() | |
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
-- This works, but is obsolete - go to https://github.com/bortels/HersheyCodea for the newest version | |
-- Just a "Main" tab for Codea to demo the class | |
function setup() | |
f=Font() | |
f:init() | |
frame=1 | |
offset = 0 | |
stroke_width=2 |
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
-- Classic 3d wireframe cube demo in LUA | |
-- based on version for PSP by Nils - ventoline.com | |
-- modified for Codea - Tom Bortels November 2011 | |
function setup() | |
--focal length to determine perspective scaling | |
focalLength = 300 | |
-- here we set up a function to make an object with | |
-- x, y and z properties to represent a 3D point. |
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
function StarField(canvas_id, width, height, num_stars) { | |
var width = width ? width : 3000, | |
height = height ? height : 1500, | |
origin_x = width / 2, | |
origin_y = height / 2, | |
stars = [], | |
num_stars = num_stars ? num_stars : 80, | |
canvas_id = canvas_id; | |
function create_star() { |
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
#!/usr/bin/perl | |
# This is ugly - I disavow all knowledge of it's existence. It was a one-off, so there are NO | |
# attempts to make it clean or understandable. HERE THERE BE DRAGONS. | |
use MIME::Base64; | |
#font = { | |
# " " = { name="space", symbol=" ", width=16, ascii=32, | |
# data={} } |
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
Keyboard = class() | |
function Keyboard:init() | |
self.keyinfo = { | |
one = { chr="1", glyph="1", schr="!", sglyph="!", row=4, col=2 }, | |
two = { chr="2", glyph="2", schr="@", sglyph="@", row=4, col=3 }, | |
three = { chr="3", glyph="3", schr="#", sglyph="#", row=4, col=4 }, | |
four = { chr="4", glyph="4", schr="$", sglyph="$", row=4, col=5 }, | |
five = { chr="5", glyph="5", schr="%", sglyph="%", row=4, col=6 }, | |
six= { chr="6", glyph="6", schr="^", sglyph="^", row=4, col=7 }, |
OlderNewer