Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup()
- if1 = false
- rot = 360
- strawberry = {}
- s = Strawberries()
- be = Begin()
- floor = physics.body(EDGE,vec2(0,45),vec2(WIDTH,45))
- leftwall = physics.body(EDGE,vec2(45,HEIGHT+200),vec2(45,0))
- rightwall = physics.body(EDGE,vec2(WIDTH-45,0),vec2(WIDTH-45,HEIGHT+200))
- startJourney = false
- jam = physics.body(POLYGON,vec2(0,0),vec2(0,1024/3-150), vec2(768/3-165,1024/3-150),vec2(0,0),vec2(768/3-165,0),vec2(768/3-165,1024/3-150))
- jam.x = WIDTH-200
- jam.y = 45
- jam.type = STATIC
- if startJourney == true then
- floor:destroy()
- floor = nil
- leftwall:destroy()
- leftwall = nil
- rightwall:destroy()
- rightwall = nil
- jam:destroy()
- jam = nil
- end
- end
- function draw()
- -- This sets a dark background color
- background(40, 40, 50)
- if startJourney == false then
- sprite("Documents:BackgroundBrown",WIDTH/2,HEIGHT/2)
- -- This sets the line thickness
- popStyle()
- -- sprite("Documents:MainHero",WIDTH/2,HEIGHT/2)
- pushStyle()
- for a,b in pairs(strawberry) do
- b:draw()
- end
- music()
- -- Do your drawing here
- pushMatrix()
- translate(jam.x+50,jam.y+100)
- rotate(jam.angle)
- sprite("Documents:JamStraw",0,0,1024/3,768/3)
- -- sprite("Documents:JamStraw",WIDTH-150,145,1024/3,768/3)
- popMatrix()
- print (#strawberry)
- if #strawberry >6 then
- table.remove(strawberry,1)
- strawberry[1] = nil
- end
- rot = rot - 0.1
- pushMatrix()
- sprite("Documents:Start",WIDTH/2,HEIGHT/2,1024/3,768/3)
- end
- if startJourney == false then
- if CurrentTouch.x > WIDTH/2-50 and CurrentTouch.y > HEIGHT/2-50 and CurrentTouch.x < WIDTH/2+50 and CurrentTouch.y < HEIGHT/2+50 then
- translate(WIDTH/2,HEIGHT/2)
- rotate(rot)
- startJourney = true
- else sprite("Documents:Start",WIDTH/2,HEIGHT/2,1024/3,768/3)
- rot = 360
- end
- end
- popMatrix()
- if startJourney == true then
- be:draw()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement