Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- import SpriteKit
- class ResetNode: SKSpriteNode {
- required init?(coder aDecoder: NSCoder) {
- super.init(coder: aDecoder)
- self.color = .white
- setup()
- }
- func setup() {
- let body = SKPhysicsBody(rectangleOf: frame.size)
- body.isDynamic = true
- body.allowsRotation = false
- body.pinned = false
- body.affectedByGravity = true
- body.friction = 0.0
- body.restitution = 0.0
- body.linearDamping = 1.0
- body.angularDamping = 1.0
- body.mass = 1.0
- body.velocity = CGVector(dx: 0, dy: 0)
- body.density = 1.0
- body.charge = 1.0
- body.categoryBitMask = 4294967295
- body.collisionBitMask = 4294967295
- body.fieldBitMask = 4294967295
- body.contactTestBitMask = 0
- self.physicsBody = body
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement