Created
April 19, 2015 07:22
-
-
Save efrenjgb/7c97b482acc76462cdb8 to your computer and use it in GitHub Desktop.
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
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) { | |
/* Called when a touch begins */ | |
for touch in (touches as! Set<UITouch>) { | |
let location = touch.locationInNode(self) | |
moveShipTo(location) | |
self.fireWeapon = true | |
} | |
} | |
override func touchesMoved(touches: Set<NSObject>, withEvent event: UIEvent) { | |
for touch in (touches as! Set<UITouch>) { | |
let location = touch.locationInNode(self) | |
moveShipTo(location) | |
} | |
} | |
override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) { | |
for touch in (touches as! Set<UITouch>) { | |
let location = touch.locationInNode(self) | |
self.fireWeapon = false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment