Skip to content

Commit

Permalink
Version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
krayc425 committed Nov 21, 2017
1 parent 01d0a44 commit 8316d7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions TouchBreakout/GameScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class GameScene: SKScene {
ball.physicsBody?.velocity = .zero
velocityDx = 0.0
velocityDy = 0.0
isLeftPressed = false
isRightPressed = false
removedBlocks.forEach { self.addChild($0) }
removedBlocks.removeAll()
}
Expand All @@ -120,13 +122,17 @@ class GameScene: SKScene {
velocityDx = ball.physicsBody?.velocity.dx ?? 0.0
velocityDy = ball.physicsBody?.velocity.dy ?? 0.0
ball.physicsBody?.velocity = .zero
isLeftPressed = false
isRightPressed = false
gameState = .paused
}
}

private func continueGame() {
if gameState == .paused {
ball.physicsBody?.velocity = CGVector(dx: velocityDx, dy: velocityDy)
isLeftPressed = false
isRightPressed = false
gameState = .running
}
}
Expand Down Expand Up @@ -218,8 +224,8 @@ class GameScene: SKScene {
}

// if too horizontal...
if fabs(Double((ball.physicsBody?.velocity.dy)!)) < 30 {
ball.physicsBody?.applyImpulse(CGVector(dx: 0, dy: 2))
if fabs(Double((ball.physicsBody?.velocity.dy)!)) < 20 {
ball.physicsBody?.applyImpulse(CGVector(dx: 0, dy: 1))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions TouchBreakout/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>9</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit 8316d7c

Please sign in to comment.