Skip to content

Commit 8316d7c

Browse files
committed
Version 1.1
1 parent 01d0a44 commit 8316d7c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

TouchBreakout/GameScene.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

TouchBreakout/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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>

0 commit comments

Comments
 (0)