Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function onSetScore(event)
- if gameIsActive == true then
- if event.phase == "began" then
- if event.other.myName == "arrow" then
- if gameIsActive == true then
- local newScore = gameScore + 1
- local arrowScore = display.newText("1",0,0,"Raleway-SemiBold", 15)
- arrowScore:setFillColor(r,g,b)
- arrowScore.x = event.other.x
- arrowScore.y = event.other.y - 10
- physics.addBody(arrowScore,"dynamic", {friction=10,density=10,bounce=10,radius=1, filter=obstaclesCollisionFilter})
- arrowScore:applyForce( 0, -10, event.other.x, event.other.y - 10 )
- setScore(newScore)
- audio.play(sfx[3])
- arrows[numArrows] = event.other.myName
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement