This file contains hidden or 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
-- swipe library | |
--[[ Libraries ]]-- | |
local composer = require("composer") | |
--[[ Fields ]]-- | |
local mainstage = display.getCurrentStage() | |
local stage = composer.stage |
This file contains hidden or 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
-- arrow test | |
-- http://www.iforce2d.net/b2dtut/sticky-projectiles | |
-- video: http://screencast.com/t/vcPLSJR6xkIq | |
require("mathlib") | |
local sWidth, sHeight = display.actualContentWidth, display.actualContentHeight | |
local centerX, centerY = sWidth/2, sHeight/2 |
This file contains hidden or 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
--[[ | |
Perspective v2.0.2 | |
A library for easily and smoothly integrating a virtual camera into your game. | |
Based on modified version of the Dusk camera system. | |
v2.0.2 adds a more stable tracking system and re-implements scrollX and scrollY | |
--]] |
This file contains hidden or 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
--[[ | |
statemachine.lua | |
Copyright (c) 2013 Erin Lin | |
erinylin.blogspot.com | |
Licensed under the MIT license. | |
Usage: | |
local sm = require("statemachine") | |
local process = sm.new(function(self, time) |
This file contains hidden or 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
Ellipse = { | |
--declare constants | |
format='%d %d %d %d ', | |
class=',Ellipse,class,' | |
} | |
function Ellipse:tostring() | |
return string.format(self.format,self.x,self.y,self.width,self.height) | |
end --tostring | |
function Ellipse:new(centerX, centerY, wide, tall) | |
assert(wide>=0 and tall>=0) |
This file contains hidden or 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
local bg = display.newImage("images/bg.png") | |
bg.x = _W/2; bg.y = _H/2; | |
local car = display.newImage("images/car.png") | |
car.x = _W/2 | |
car.y = _H - 250 | |
car.name = "car" | |
-- understood proprierties of bezier curve | |
--local curve = bezier:curve({xInitial, xControlPoint1, xControlPoint2, xControlPoint3}, {yInitial, yControlPoint1, yControlPoint2, yControlPoint3}) |
This file contains hidden or 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
{ | |
"sheet_bat": { | |
"class": ",imagesheet,", | |
"path": "images/bat.png", | |
"options": { | |
"width": 32, "height": 48, "numFrames": 12, | |
"sheetContentWidth": 192, "sheetContentHeight": 96 | |
} | |
}, | |
"background_mountain": { |
This file contains hidden or 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
-- swipe library | |
--[[ Libraries ]]-- | |
local composer = require("composer") | |
--[[ Fields ]]-- | |
local mainstage = display.getCurrentStage() | |
local stage = composer.stage |
This file contains hidden or 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
-- | |
-- a simple Lua/Corona joystick module based on Rob Miracle's code: | |
-- http://forums.coronalabs.com/topic/32941-virtual-joystick-module-for-games/ | |
-- simplified some of the code, removing some nice-ities, but it still works | |
local Joystick = {} | |
function Joystick.new( innerRadius, outerRadius ) | |
local stage = display.getCurrentStage() | |
This file contains hidden or 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
currColor = "white" | |
local function save( ) | |
display.save( allGroup, "group.jpg" ) | |
end | |
local function loadVars(theSize) | |
math.randomseed( os.time( ) ) | |
allGroup = display.newGroup() | |
rectangles = {} | |
currW = theSize |