Skip to content

Instantly share code, notes, and snippets.

@peteroyle
peteroyle / gist:2652743
Created May 10, 2012 12:24
Split Screen In Codea
--# Menu
Menu = class()
function Menu:init()
end
function Menu:draw()
if self.main then
@peteroyle
peteroyle / gist:2659283
Created May 11, 2012 12:17
Codea Achievements Framework
--# PointSizeHelper
function pointsScaled(width)
if WIDTH == 1024 then
pointRatio = WIDTH / 10000
else
pointRatio = WIDTH / 5500
end
return width * pointRatio
@peteroyle
peteroyle / gist:5315918
Created April 5, 2013 01:31
Example of Ruby's behavior when modifying properties/values of objects/hashes passed as parameters
This test passes:
it "should tell me how params are passed" do
# that new car smell
car = Car.new
car.colour = "blue"
# this car smells like hash
car_hash = {'colour' => 'blue'}
# both cars were created blue yeah?