Skip to content

Commit

Permalink
make sure scene is paused and removed when game ends
Browse files Browse the repository at this point in the history
  • Loading branch information
literalpie committed Dec 21, 2020
1 parent 0e9485e commit 16ea983
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Wonky Blocks.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
45A248C424965BB40030EC50 /* physicsCategories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = physicsCategories.swift; sourceTree = "<group>"; };
45BEC135244E5D6400B38F83 /* SwiftClipperPath+asCgPath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SwiftClipperPath+asCgPath.swift"; sourceTree = "<group>"; };
45CFA6FC2590FA42000509BB /* Screenshots-instructions.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = "Screenshots-instructions.md"; sourceTree = "<group>"; };
45CFA6FF25910D7E000509BB /* app-store-description.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = "app-store-description.md"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -118,6 +119,7 @@
45525A5C244C7FD4004974AB = {
isa = PBXGroup;
children = (
45CFA6FF25910D7E000509BB /* app-store-description.md */,
45CFA6FC2590FA42000509BB /* Screenshots-instructions.md */,
459133A42496CAE6006BAC3D /* README.md */,
45332F4924ECA14500F7A72C /* Documentation */,
Expand Down Expand Up @@ -446,7 +448,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Wonky Blocks/Wonky Blocks.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_ASSET_PATHS = "\"Wonky Blocks/Preview Content\"";
DEVELOPMENT_TEAM = Z6E4CU9G46;
ENABLE_PREVIEWS = YES;
Expand All @@ -469,7 +471,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Wonky Blocks/Wonky Blocks.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_ASSET_PATHS = "\"Wonky Blocks/Preview Content\"";
DEVELOPMENT_TEAM = Z6E4CU9G46;
ENABLE_PREVIEWS = YES;
Expand Down
3 changes: 3 additions & 0 deletions Wonky Blocks/UI/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class WonkyGameViewController: UIViewController {
}

deinit {
spriteKitView.scene?.isPaused = true
spriteKitView.presentScene(nil)
physicsController.can?.cancel()
allCans.forEach { $0.cancel() }
}
Expand All @@ -57,6 +59,7 @@ class WonkyGameViewController: UIViewController {

// update row indicators (this block doesn't remove ant rows)
let timerCan = Timer.publish(every: 0.1, on: .main, in: .common).autoconnect().sink { (_) in

DispatchQueue.global(qos: .background).async {
// gets the percentage that each row is filled compared to the target required to clear a row
let rowStates = self.rows.map { $0.calculateRowArea() / Self.rowFilledThreshold }
Expand Down
10 changes: 10 additions & 0 deletions app-store-description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# App Store Description

> This is the description that shows up with that app in the app store. If anyone has a suggestion on different wording, open a PR to change this file. It's not automated or anything, but I will try to keep the app store description up to date with this.
You may notice I didn't mention Tetris by name. This is intentional.

An interesting twist on the classic puzzle arcade game we all love. By removing the restrictions of a grid and adding physics, this game is a new, yet familiar challenge.

As the pieces fall from the top of the board, your goal is to last as long as possible without the game area overflowing. Lines are removed when you fill them up with enough pieces. The longer you last, the faster pieces fall and the more points you get.

This is an open source game. Anyone can see the code on GitHub and contribute their own changes to the game.

0 comments on commit 16ea983

Please sign in to comment.