File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ class GameScene: SKScene {
104104 ball. physicsBody? . velocity = . zero
105105 velocityDx = 0.0
106106 velocityDy = 0.0
107+ isLeftPressed = false
108+ isRightPressed = false
107109 removedBlocks. forEach { self . addChild ( $0) }
108110 removedBlocks. removeAll ( )
109111 }
@@ -120,13 +122,17 @@ class GameScene: SKScene {
120122 velocityDx = ball. physicsBody? . velocity. dx ?? 0.0
121123 velocityDy = ball. physicsBody? . velocity. dy ?? 0.0
122124 ball. physicsBody? . velocity = . zero
125+ isLeftPressed = false
126+ isRightPressed = false
123127 gameState = . paused
124128 }
125129 }
126130
127131 private func continueGame( ) {
128132 if gameState == . paused {
129133 ball. physicsBody? . velocity = CGVector ( dx: velocityDx, dy: velocityDy)
134+ isLeftPressed = false
135+ isRightPressed = false
130136 gameState = . running
131137 }
132138 }
@@ -218,8 +224,8 @@ class GameScene: SKScene {
218224 }
219225
220226 // if too horizontal...
221- if fabs ( Double ( ( ball. physicsBody? . velocity. dy) !) ) < 30 {
222- ball. physicsBody? . applyImpulse ( CGVector ( dx: 0 , dy: 2 ) )
227+ if fabs ( Double ( ( ball. physicsBody? . velocity. dy) !) ) < 20 {
228+ ball. physicsBody? . applyImpulse ( CGVector ( dx: 0 , dy: 1 ) )
223229 }
224230 }
225231 }
Original file line number Diff line number Diff line change 1717 <key >CFBundlePackageType </key >
1818 <string >APPL </string >
1919 <key >CFBundleShortVersionString </key >
20- <string >1.0. 1 </string >
20+ <string >1.1 </string >
2121 <key >CFBundleVersion </key >
22- <string >1 </string >
22+ <string >9 </string >
2323 <key >LSApplicationCategoryType </key >
2424 <string >public.app-category.games </string >
2525 <key >LSMinimumSystemVersion </key >
You can’t perform that action at this time.
0 commit comments