Last active
February 28, 2019 19:37
-
-
Save alcidesjunior/26e0b347128239677a2ad74a749dd23f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//criando o corpo 1 que é em formato de circulo. | |
let element = SKShapeNode(circleOfRadius: 10) | |
element.position = CGPoint(x: 100 ,y: 140) | |
element.fillColor = .yellow | |
element.physicsBody = SKPhysicsBody(circleOfRadius: 10) | |
//setando configurações de colisão | |
element.physicsBody?.restitution = 1 | |
element.physicsBody?.categoryBitMask = 2 | |
element.physicsBody?.collisionBitMask = 1 | |
element.physicsBody?.fieldBitMask = 0 | |
element.physicsBody?.contactTestBitMask = 1 | |
element.name = "ball" | |
addChild(element) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment