Skip to content

Commit

Permalink
IOS-574 Remove MinIntervalBetweenTwoAcceptedTouches (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonParis95 authored and m-herold committed Jul 16, 2018
1 parent a00defb commit e4fe7b5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/Catty/PlayerEngine/CBPlayerConfig.swift
Expand Up @@ -22,7 +22,6 @@

struct PlayerConfig {
static let LoopMinDurationTime = 0.005 //5ms //0.02 // 20ms
static let MinIntervalBetweenTwoAcceptedTouches = 0.2 // 200ms
static let MaxRecursionLimitOfSelfBroadcasts = 40
static let NumberOfWaitQueuesInitialValue = 3
static let RotationDegreeOffset = 90.0 // needed for CBSceneHelper
Expand Down
10 changes: 0 additions & 10 deletions src/Catty/PlayerEngine/DataModel/CBSpriteNode/CBSpriteNode.swift
Expand Up @@ -57,7 +57,6 @@ final class CBSpriteNode: SKSpriteNode {
return CBSceneHelper.convertSceneToDegrees(Util.radians(toDegree: Double(self.zRotation)))
}
}
private var _lastTimeTouchedSpriteNode = [String:Date]()

// MARK: Custom getters and setters
@objc func setPositionForCropping(_ position: CGPoint) {
Expand Down Expand Up @@ -244,15 +243,6 @@ final class CBSpriteNode: SKSpriteNode {
return false
}

if let lastTime = _lastTimeTouchedSpriteNode[spriteName] {
let duration = Date().timeIntervalSince(lastTime)
// ignore multiple touches on same sprite node within a certain amount of time...
if duration < PlayerConfig.MinIntervalBetweenTwoAcceptedTouches {
return true
}
}
_lastTimeTouchedSpriteNode[spriteName] = Date()

scheduler.startWhenContextsOfSpriteNodeWithName(spriteName)

return true
Expand Down

0 comments on commit e4fe7b5

Please sign in to comment.