Skip to content

Instantly share code, notes, and snippets.

@dermotbalson
dermotbalson / 3D
Created April 18, 2013 05:50
3D racer
--# Main
-- Main
function setup()
--you need to configure these before you run it
--The track itself
imgTrackName="Documents:track 2" --the image
start={x=50,y=175} --the starting point - MUST BE A TRACK PIXEL
--The texture for the barrier wall
@dermotbalson
dermotbalson / gist:5411469
Created April 18, 2013 09:35
3D racer with nose
--# Main
-- Main
function setup()
--you need to configure these before you run it
--The track itself
imgTrackName="Documents:track 2" --the image
imgNose=readImage("Dropbox:nosecone")
start={x=50,y=175} --the starting point - MUST BE A TRACK PIXEL
-- Main
function setup()
numtouches=0 --number of current touches
aim={id=0,x=0,y=0} --details for touch which is aiming
createScope()
shots={} --table for shots fired
shotSize=7 --size of shot mark
shotColour=color(255)
print("Hold and move one finger on the screen to aim")
-- Main
function setup()
numtouches=0 --number of current touches
aim={id=0,x=0,y=0} --details for touch which is aiming
createScope()
CreateBackground()
shots={} --table for shots fired
shotSize=7 --size of shot mark
parameter.integer("Zoom",1,5,2)
@dermotbalson
dermotbalson / gist:5433245
Created April 22, 2013 08:22
card shuffle
--# Main
-- Cards
-- Use this function to perform your initial setup
function setup()
p=Pack(3) --use 3 packs
local i=0
repeat
i=i+1
--# Main
-- Main
-- Use this function to perform your initial setup
function setup()
--b=Backup("Cards v105")
img=readImage("Small World:Watch Tower") --image for back of card
dealPokerHand()
print("Touch the screen to redeal the hand")
function setup()
x=50 --starting x
y=50 --starting y
d=60 --diameter of ball
dx=2 --the amount x changes
dy=1 --the amount y changes
end
function draw()
background(200,200,200,255)
function setup()
physics.gravity(0,0)
bullets={}
end
function touched(touch)
x = touch.x
y = touch.y
if touch.state == BEGAN then --create bullet
local bullet = physics.body(CIRCLE,10) -- <<NEW
function setup()
physics.gravity(0,0)
bullets={}
ball={}
ball = {} --NEW
for i = 1,5 do --NEW
ball[i] = Ballons()
end
end
@dermotbalson
dermotbalson / gist:5465527
Last active December 16, 2015 16:49
bullets3
function setup()
physics.gravity(0,0)
bullets={}
ball = {} --NEW
for i = 1,5 do --NEW
ball[i] = Ballons()
end
end
function touched(touch)