Last active
January 29, 2016 12:22
-
-
Save lucasprag/caeaf4079a3725cc8307 to your computer and use it in GitHub Desktop.
Touch me to impulse
This file contains 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
// omitted | |
class GameScene: SKScene { | |
// omitted | |
override func didMoveToView(view: SKView) { | |
// omitted | |
} | |
// This method is called when the user touches the screen | |
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { | |
// we apply an impulse to the axis Y of 70 | |
player.physicsBody?.applyImpulse(CGVector(dx: 0.0, dy: 70.0)) | |
} | |
// omitted | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment