Skip to content

Instantly share code, notes, and snippets.

View reefwing's full-sized avatar

David Such reefwing

View GitHub Profile
@reefwing
reefwing / Dial.lua
Created July 30, 2012 11:05
Tutorial 10 - A Simple Dial Class
--# Dial
Dial = class()
-- A Dial Class
-- Reefwing Software (www.reefwing.com.au)
--
-- 26 July 2012
-- Version 1.0
function Dial:init(x, y, angle)
@reefwing
reefwing / Main.lua
Created July 31, 2012 11:05
Tutorial 11 - Physics 101
supportedOrientations(ANY)
function setup()
-- Physics Demo Metadata
version = 1.0
saveProjectInfo("Description", "Physics v"..version)
saveProjectInfo("Author", "Reefwing Software")
@reefwing
reefwing / Codea_Class_Template.lua
Created August 18, 2012 00:31
Interlude 11 - Classes in Lua and Codea
MyClass = class()
function MyClass:init(x)
-- you can accept and set parameters here
self.x = x
end
function MyClass:draw()
-- Codea does not automatically call this method
end
@reefwing
reefwing / Colors.lua
Created August 25, 2012 05:52
Tutorial 14 - An Extended Ship Class
--# Colors
-- Make available the predefined colors from UIColor
--
-- Version 1.1
blackColor = color(0, 0, 0)
darkGrayColor = color(85, 85, 85)
lightGrayColor = color(170, 170, 170)
whiteColor = color(255, 255, 255)
grayColor = color(128, 128, 128)
@reefwing
reefwing / ToString.lua
Created September 8, 2012 12:39
Tutorial 16 - Table to String & String to Table
--# ToString
--
-- Converts an arbitrary data type into a string. Will recursively convert
-- tables.
--
-- () param data The data to convert.
-- () param indent (optional) The number of times to indent the line. Default is 0.
--
-- () return A string representation of a data, will be one or more full lines.
--
@reefwing
reefwing / FileManager.lua
Created September 20, 2012 11:00
Tutorial 17 - A Simple File Manager for Codea
-- Define Directory Types
ProjectInfo = 1
ProjectData = 2
LocalData = 3
GlobalData = 4
-- Class version
version = 1.1
@reefwing
reefwing / Button.lua
Created September 30, 2012 00:44
Tutorial 18 - Saving and Loading Complicated Tables
--# Button
Button = class()
function Button:init(x, y, pressed, text)
-- Initialise Button
self.x = x or 0
self.y = y or 0
self.pressed = pressed or false
@reefwing
reefwing / MenuBar.lua
Created September 30, 2012 00:54
Tutorial 18 - Saving and Loading Complicated Tables (Part 2)
--# MenuBar
-- MenuBar Class
--
-- Developed by @dave1707
-- 16th September 2012
--
-- Version 1.1
--
-- Modified by: Reefwing Software
--
@reefwing
reefwing / aGameCenter_Codea.h
Created October 14, 2012 04:19 — forked from juaxix/aGameCenter_Codea.h
Tutorial 21 - Game Center for Codea (multiple Leaderboards and Achievements)
//
// aGameCenter_Codea.h
//
// Created by Juan Belón on 28/05/12
// Games -> http://www.xixgames.com
// LGPL - @juaxix - Codea connection!
//
// Modified by Reefwing Software on 14/10/12
// http://www.reefwing.com.au
// @reefwing on the Codea Forums
@reefwing
reefwing / CodifyAppDelegate.h
Created November 18, 2012 00:27
Tutorial 23 - iAds for Codea
//
// CodifyAppDelegate.h
// Codify
//
// Created by Simeon Nasilowski on 14/05/11.
//
// Copyright 2012 Two Lives Left Pty. Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.