Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local collisionTable =
- {
- --paraGlideProp = bulletProp + firstParaPlatformProp + secondParaPlatformProp
- paraGlideProp =
- {
- density = 1.0,
- friction = 0.0,
- shape=
- {
- -20, 81.5 , -70, -28.5 , 55, -29.5
- },
- bounce = 0.0,
- filter =
- {
- categoryBits = 1,
- maskBits = 52
- }
- },
- --secondParaPlatformProp = paraGlideProp + bombProp + fragProp
- secondParaPlatformProp =
- {
- density = 100000.0,
- friction = 1000.0,
- bounce = 0.0,
- filter =
- {
- categoryBits = 32,
- maskBits = 641
- }
- },
- --bombProp = secondParaPlatformProp + bulletProp
- bombProp =
- {
- density = 1.0,
- friction = 0.3,
- bounce = 0.2,
- filter =
- {
- categoryBits = 128,
- maskBits = 36
- }
- },
- --fragProp = secondParaPlatformProp
- fragProp =
- {
- shape = { -3.5, 21 , -4.5, 24 , -7.5, 23 , -7.5, 20 , -5.5, 17 },
- filter =
- {
- categoryBits = 512,
- maskBits = 32
- }
- }
- }
- local frag = getSprite( spriteData.fragData )
- frag.name = "frag"
- frag.x = 200
- frag.y = 10
- frag.collision = onCatchPlatformCollision2
- frag:addEventListener("collision", frag)
- physics.addBody( frag, "dynamic", collisionTable.fragProp)
- frag:play()
- function setUpCatchPlatform2()
- local platform2 = display.newRect( 0, 0, display.contentWidth * 4, 0)
- platform2.myName = "platform2"
- platform2.x = (display.contentWidth / 2)
- platform2.y = (display.contentHeight / 2) + 135
- physics.addBody(platform2, "static", collisionTable.secondParaPlatformProp)
- platform2.collision = onCatchPlatformCollision2
- platform2:addEventListener( "collision", platform2 )
- end
- function onCatchPlatformCollision2(self, event)
- if event.phase == "began" and event.other.name == "frag" then
- print("frag")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment