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
function intersection(p11,p12,p21,p22) | |
local Z = (p12.y-p11.y)*(p21.x-p22.x)-(p21.y-p22.y)*(p12.x-p11.x); | |
local Ca = (p12.y-p11.y)*(p21.x-p11.x)-(p21.y-p11.y)*(p12.x-p11.x); | |
local Cb = (p21.y-p11.y)*(p21.x-p22.x)-(p21.y-p22.y)*(p21.x-p11.x); | |
if Z == 0 and Ca == 0 and Cb == 0 then return nil end | |
if Z == 0 then return nil end |
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
-- show rating prompt | |
local function ratingPrompt() | |
local function ask() | |
local function answer(event) | |
if ("clicked" == event.action) then | |
if (event.index == 1) then | |
system.openURL("http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=440754678") | |
data.rated = "yes" | |
writeData() | |
elseif (event.index == 2) then |
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
-- iap results | |
function iapTransaction(event) | |
if (event.transaction.state == "purchased") or (event.transaction.state == "restored") then | |
if (event.transaction.productIdentifier == "playmaticBalloons") then | |
data.iap.iapBalloons = "yes" | |
iconBalloonsPrice.alpha = 0 | |
end | |
writeData() | |
elseif (event.transaction.state == "cancelled") then | |
elseif (event.transaction.state == "failed") then |
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 targetDevice = ( system.getInfo( "model" ) ) | |
local isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 ) | |
if isTall == false and targetDevice == "iPhone" then | |
application = | |
{ | |
content = | |
{ | |
width = 320, | |
height = 480, |