--# Main
-- Crane Claw
-- Use this function to perform your initial setup
function setup()
supportedOrientations(LANDSCAPE_ANY)
displayMode(FULLSCREEN)
LCM = SQUARE
start = 0
winscreen = 1
playLvlOne = 2
playLvlTwo = 3
winscreenTwo = 4
info = 5
playLvlThree = 6
winscreenThree = 7
playLvlFour = 8
winscreenFour = 9
playLvlFive = 10
winscreenFive = 11
playLvlSix = 12
winscreenSix = 13
playLvlSven = 14
crateX = 0
crateY = 0
crateBlueX = 0
crateBlueY = 0
crateYellowX = 0
crateYellowY = 0
crateTwoX = 0
crateTwoY = 0
crateBlueTwoX = 0
crateBlueTwoY = 0
crateYellowTwoX = 0
crateYellowTwoY = 0
rectDis = 0
state = start
end
-- This function gets called once every frame
function draw()
background(59)
if state == start then
background(69)
font("Futura-CondensedMedium")
fill(255, 0, 0, 255)
fontSize(125)
text("Crane Claw", 400, 400)
fontSize(55)
fill(255, 255, 255, 255)
text("Created and Developed by: \n Apple Smell Games", 300, 600)
fontSize(50)
noStroke()
fill(127, 127, 127, 255)
rect(200, 200, 100, 100)
fill(255, 255, 255, 255)
text("Play", 250, 250)
fill(127, 127, 127, 255)
rect(500, 200, 100, 100)
fill(255, 255, 255, 255)
text("Info", 550, 250)
sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
--Play!
if CurrentTouch.x >194 and CurrentTouch.x <304 and CurrentTouch.y >194 and CurrentTouch.y <304 then
state = playLvlOne
end
--Info!
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >194 and CurrentTouch.y <304 then
state = info
end
end
if state == info then
background(255, 0, 0, 255)
fontSize(25)
fill(255)
text("If there shows no goal, just place a crate on a pad. \n If there is a goal, follow it \n Somtimes there will be picture goals. \n The color brick on the picture goals means any crate \n of the same color. If you get an image in a level that looks like a wall witha curved top, \n that means any crate of that color", 355, 650)
fill(127, 127, 127, 255)
rect(300, 400, 100, 100)
fill(0, 255, 71, 255)
text("Back", 350, 450)
if CurrentTouch.x >294 and CurrentTouch.x <404 and CurrentTouch.y >394 and CurrentTouch.y <504 then
state = start
end
end
if state == playLvlOne then
background(56)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)
--Goal pad
sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >94 and CurrentTouch.y <154 then
state = winscreen
end
end
end
if state == winscreen then
background(255, 255, 0, 255)
fill(255, 0, 0, 255)
text("Winner!", 400, 500)
noStroke()
fill(127, 127, 127, 255)
rect(600, 400, 100, 100)
fontSize(25)
fill(0, 0, 0, 255)
text("Next Level", 650, 450)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >394 and CurrentTouch.y <504 then
state = playLvlTwo
end
for i = 1,3 do
tint(0, 255, 0, 255)
sprite("SpaceCute:Star", 200 * i, 200)
end
end
if state == playLvlTwo then
background(56)
fill(0, 0, 0, 255)
textWrapWidth(300)
text("Goal: \n match the crates to the same color goal pads.", 250, 650)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate Red
tint(255, 0, 0, 255)
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)
--Goal pad Red
tint(255, 0, 0, 255)
sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >94 and CurrentTouch.y <154 then
sprite("Cargo Bot:Crate Green 1", crateX, crateY)
crateY = 120
crateX = 300
end
end
if crateY == 120 and crateX == 300 then
sprite("Cargo Bot:Crate Green 1", crateX, crateY)
--Crate Blue
tint(0, 0, 255, 255)
sprite("Cargo Bot:Crate Yellow 1", CurrentTouch.x, CurrentTouch.y)
--Goal Pad Blue
--Sorry if its a bit hard to see...
tint(0, 0, 255, 255)
sprite("Cargo Bot:Claw Middle", 500, 100, 100, 50)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >494 and CurrentTouch.x <504 and CurrentTouch.y >94 and CurrentTouch.y <154 then
sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
crateBlueY = 120
crateBlueX = 500
end
end
if crateBlueX == 500 and crateBlueY == 120 then
sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
noStroke()
fill(127, 127, 127, 255)
rect(600, 500, 100, 100)
fill(255, 255, 255, 255)
fontSize(25)
text("Next", 650, 550)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >494 and CurrentTouch.y <604 then
state = winscreenTwo
end
end
end
end
if state == winscreenTwo then
background(255, 255, 0, 255)
fontSize(50)
fill(255, 0, 0, 255)
text("YOU WIN!!!", 400, 500)
for i = 1,3 do
tint(0, 255, 0, 255)
sprite("SpaceCute:Star", 200 * i, 200)
end
fill(127, 127, 127, 255)
rect(500, 500, 100, 100)
fill(255, 255, 255, 255)
text("Next", 550, 550)
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
state = playLvlThree
end
end
if state == playLvlThree then
background(56)
fontSize(25)
text("Goal: \n Stack two green crates", 200, 650)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)
--Goal pad
sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateX = 300
crateY = 130
sprite("Cargo Bot:Crate Green 1", crateX, crateY)
end
end
if crateX == 300 and crateY == 130 then
sprite("Cargo Bot:Crate Green 1", crateX, crateY)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >154 and CurrentTouch.y <198 then
crateBlueX = 300
crateBlueY = 174
sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
end
end
end
if crateBlueX == 300 and crateBlueY == 174 then
sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
noStroke()
fill(127, 127, 127, 255)
rect(600, 500, 100, 100)
fill(255, 255, 255, 255)
fontSize(25)
text("Next", 650, 550)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >494 and CurrentTouch.y <604 then
state = winscreenThree
end
end
end
if state == winscreenThree then
background(255, 255, 0, 255)
fontSize(35)
fill(0, 0, 0, 255)
text("Win Win Win Win! ITS ALL YOU CAN EVER DO!", 300, 400)
for i = 1,3 do
tint(0, 255, 0, 255)
sprite("SpaceCute:Star", 200 * i, 200)
end
fill(127, 127, 127, 255)
rect(500, 500, 100, 100)
fill(0, 0, 0, 255)
text("Next", 550, 550)
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
state = playLvlFour
end
end
if state == playLvlFour then
background(56)
fill(255, 255, 255, 255)
text("Goal:", 500, 600)
--Picture goal
tint(255, 255, 255, 255)
sprite("Cargo Bot:Goal Area", 500, 500, 200, 100)
sprite("Cargo Bot:Crate Goal Green", 520, 470)
sprite("Cargo Bot:Crate Goal Red", 540, 470)
sprite("Cargo Bot:Crate Goal Red", 520, 493)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)
--Goal pad
sprite("Cargo Bot:Claw Middle", 400, 100, 100, 50)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateX = 400
crateY = 130
sprite("Cargo Bot:Crate Green 1", crateX, crateY)
end
end
if crateX == 400 and crateY == 130 then
sprite("Cargo Bot:Crate Green 1", crateX, crateY)
sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >130 and CurrentTouch.y <164 then
crateBlueX = 400
crateBlueY = 164
end
end
if crateBlueX == 400 and crateBlueY == 164 then
sprite("Cargo Bot:Crate Red 1", crateBlueX, crateBlueY)
sprite("Cargo Bot:Crate Red 2", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >432 and CurrentTouch.x <500 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateYellowX = 450
crateYellowY = 130
end
end
end
if crateYellowX == 450 and crateYellowY == 130 then
sprite("Cargo Bot:Crate Red 2", crateYellowX, crateYellowY)
noStroke()
fill(127, 127, 127, 255)
rect(500, 400, 100, 100)
fontSize(25)
fill(255, 255, 255, 255)
text("Next", 550, 450)
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >394 and CurrentTouch.y <504 then
state = winscreenFour
end
end
end
end
if state == winscreenFour then
background(255, 255, 0, 255)
fontSize(40)
fill(255, 255, 255, 255)
text("Awsome!", 400, 400)
fill(127, 127, 127, 255)
rect(500,500, 100, 100)
fontSize(25)
fill(255, 255, 255, 255)
text("Next", 550, 550)
for i = 1,3 do
tint(0, 255, 0, 255)
sprite("SpaceCute:Star", 200 * i, 200)
end
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
state = playLvlFive
end
end
if state == playLvlFive then
background(59)
tint(255, 255, 255, 255)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
--Goal pad
sprite("Cargo Bot:Claw Middle", 400, 100, 100, 50)
sprite("Cargo Bot:Claw Middle", 600, 100, 100, 50)
sprite("Cargo Bot:Goal Area", 500, 600, 200, 100)
sprite("Cargo Bot:Crate Goal Red", 500, 570)
sprite("Cargo Bot:Crate Goal Red", 550, 570)
sprite("Cargo Bot:Crate Goal Yellow", 500, 594)
sprite("Cargo Bot:Crate Goal Yellow", 550, 594)
LMC = PROJECT
fill(255, 255, 255, 255)
text("Goal:", 500, 700)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateX = 400
crateY = 134
end
end
if crateX == 400 and crateY == 134 then
sprite("Cargo Bot:Crate Red 1", crateX, crateY)
sprite("Cargo Bot:Crate Yellow 1", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >134 and CurrentTouch.y <156 then
crateYellowX = 400
crateYellowY = 176
end
end
end
if crateYellowX == 400 and crateYellowY == 176 then
sprite("Cargo Bot:Crate Yellow 1", crateYellowX, crateYellowY)
sprite("Cargo Bot:Crate Red 2", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateBlueX = 600
crateBlueY = 134
end
end
if crateBlueX == 600 and crateBlueY == 134 then
sprite("Cargo Bot:Crate Red 2", crateBlueX, crateBlueY)
sprite("Cargo Bot:Crate Yellow 2", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >134 and CurrentTouch.y <156 then
crateTwoX = 600
crateTwoY = 176
end
end
end
if crateTwoX == 600 and crateTwoY == 176 then
sprite("Cargo Bot:Crate Yellow 2", crateTwoX, crateTwoY)
noStroke()
fill(127, 127, 127, 255)
rect(600, 600, 100, 100)
fill(255)
text("Next", 650, 650)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >594 and CurrentTouch.y <704 then
state = winscreenFive
end
end
end
end
if state == winscreenFive then
background(255, 255, 0, 255)
fill(0, 0, 0, 255)
text("Now we get a bit harder...", 400, 400)
tint(0, 255, 0, 255)
for i = 1,3 do
sprite("SpaceCute:Star", 200 * i, 200)
end
fill(127)
rect(500, 500, 100, 100)
fill(255)
text("Next", 550, 550)
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
state = playLvlSix
end
end
if state == playLvlSix then
background(59)
fill(255)
text("Goal: \n place a red on the green pad and a green on the red pad.", 500, 600)
tint(255, 255, 255, 255)
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)
tint(255, 0, 0, 255)
sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)
tint(0, 255, 0, 255)
sprite("Cargo Bot:Claw Middle", 500, 100, 100, 50)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
tint(255, 255, 255, 255)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <404 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateX = 300
crateY = 134
end
end
if crateX == 300 and crateY == 134 then
sprite("Cargo Bot:Crate Green 1", crateX, crateY)
sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateBlueX = 500
crateBlueY = 134
end
end
end
if crateBlueX == 500 and crateBlueY == 134 then
sprite("Cargo Bot:Crate Red 1", crateBlueX, crateBlueY)
noStroke()
fill(127, 127, 127, 255)
rect(600, 600, 100, 100)
fill(255)
text("Next", 650, 650)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >594 and CurrentTouch.y <704 then
state = winscreenSix
end
end
end
if state == winscreenSix then
background(255, 255, 0, 255)
fill(0, 0, 0, 255)
text("You got this far huh? \n Lets kick up the difficulty \n in level seven.", 400, 500)
tint(0, 255, 0, 255)
for i = 1,3 do
sprite("SpaceCute:Star", 200 * i, 200)
end
fill(127, 127, 127, 255)
rect(500, 500, 100, 100)
fill(255)
text("Next", 550, 550)
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
state = playLvlSeven
end
end
if state == playLvlSeven then
background(59)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
sprite("Cargo Bot:Crate Yellow 1", CurrentTouch.x, CurrentTouch.y)
fill(255, 255, 255, 255)
text("Goal:", 600, 700)
tint(255, 255, 255, 255)
--Goal
sprite("Cargo Bot:Goal Area", 600, 600, 200, 100)
--Hard >:)
sprite("Cargo Bot:Crate Goal Yellow", 570, 570)
sprite("Cargo Bot:Crate Goal Yellow", 600, 570)
sprite("Cargo Bot:Crate Goal Blue", 570, 600)
sprite("Cargo Bot:Crate Goal Red", 630, 570)
sprite("Cargo Bot:Crate Goal Yellow", 600, 600)
--Now we are talking almost impossible, look at info to help you a bit
sprite("Cargo Bot:Condition Yellow", 630, 600, 21, 21)
--Goal Pads
for i = 1,3 do
sprite("Cargo Bot:Claw Middle", 200 * i, 100, 100, 50)
end
--Touch function
if CurrentTouch.x >194 and CurrentTouch.x <304 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateYellowX = 200
crateYellowY = 134
end
if crateYellowX == 200 and crateYellowY == 134 then
sprite("Cargo Bot:Crate Yellow 1", crateYellowX, crateYellowY)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <505 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateBlueX = 400
crateBlueY = 134
end
end
end
if crateBlueX == 400 and crateBlueY == 134 then
sprite("Cargo Bot:Crate Yellow 2", crateBlueX, crateBlueY)
sprite("Cargo Bot:Crate Yellow 3", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <505 and CurrentTouch.y >134 and CurrentTouch.y <156 then
crateX = 400
crateY = 176
end
end
end
if crateX == 400 and crateY == 176 then
sprite("Cargo Bot:Crate Yellow 3", crateX, crateY)
sprite("Cargo Bot:Crate Blue 1", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >194 and CurrentTouch.x <304 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateTwoX = 200
crateTwoY = 176
end
end
end
if crateTwoX == 200 and crateTwoY == 176 then
sprite("Cargo Bot:Crate Blue 1", crateTwoX, crateTwoY)
sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >94 and CurrentTouch.y <154 then
crateBlueTwoX = 600
crateBlueTwoY = 134
end
end
end
if crateBlueTwoX == 600 and crateBlueTwoY == 134 then
sprite("Cargo Bot:Crate Red 1", crateBlueTwoX, crateBlueTwoY)
sprite("Cargo Bot:Condition Yellow", CurrentTouch.x, CurrentTouch.y)
--Lol, place down the condition for a funny ouput
if CurrentTouch.state == MOVING then
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >134 and CurrentTouch.y <174 then
crateYellowTwoX = 600
crateYellowTwoY = 176
end
end
end
if crateYellowTwoX == 600 and crateYellowTwoY == 176 then
rectDis = rectDis + 1
noStroke()
if rectDis <=499 then
fill(255, 220, 0, 255)
elseif rectDis >=500 then
fill(255, 255, 255, 0)
for i = 1,3 do
sprite("Cargo Bot:Crate Yellow 3", 200 * i, 176)
end
end
rect(0, 174, 1000, 50)
end
end
end
function bottomQuick()
--My iPad laggs when going down so i use this function to get to the bottom
end
--# Participate
--You can participate with me and Apple Smell Games in our games.
--Contatct me(apple smell games owner)
--Gmail:
--marcoman0007@gmail.com
--Twitter:
--@iPadtutorial909
--Facebook:
--Kizzy Mariason
--Youtube:
--iPadtutorial909
--Hope you do!
--We are looking for employeys with a MacBook or iMac!
--We are realeasing apps to the App Store.
--No pay for anyone until we earn enough money :(
--Hope you join! :)