├── GameDoneSwift-iPhone
├── GameDoneSwift
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── unicorn.imageset
│ │ │ ├── unicorn.png
│ │ │ └── Contents.json
│ │ ├── background.imageset
│ │ │ ├── background.png
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── GameScene.sks
│ ├── sickBeats.mp3
│ ├── PhysicsBitMasks.swift
│ ├── Info.plist
│ ├── GameViewController.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ ├── AppDelegate.swift
│ └── GameScene.swift
└── GameDoneSwift.xcodeproj
│ ├── project.xcworkspace
│ └── contents.xcworkspacedata
│ └── project.pbxproj
├── .gitignore
├── README.md
└── LICENSE
/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/GameScene.sks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM-MIL/GameDoneSwift/HEAD/GameDoneSwift-iPhone/GameDoneSwift/GameScene.sks
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/sickBeats.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM-MIL/GameDoneSwift/HEAD/GameDoneSwift-iPhone/GameDoneSwift/sickBeats.mp3
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/unicorn.imageset/unicorn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM-MIL/GameDoneSwift/HEAD/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/unicorn.imageset/unicorn.png
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/background.imageset/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IBM-MIL/GameDoneSwift/HEAD/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/background.imageset/background.png
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/PhysicsBitMasks.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PhysicsBitMasks.swift
3 | // GameDoneSwift
4 | //
5 | // Created by Evan Compton on 2/5/16.
6 | // Copyright © 2016 IBM MIL. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class PhysicsBitMasks: NSObject {
12 | static let player: UInt32 = 0x1 << 0
13 | static let ground: UInt32 = 0x1 << 1
14 | }
15 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/unicorn.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "unicorn.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/background.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "background.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UIStatusBarHidden
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationLandscapeLeft
38 | UIInterfaceOrientationLandscapeRight
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata
19 |
20 | ## Other
21 | *.xccheckout
22 | *.moved-aside
23 | *.xcuserstate
24 | *.xcscmblueprint
25 |
26 | ## Obj-C/Swift specific
27 | *.hmap
28 | *.ipa
29 |
30 | ## Playgrounds
31 | timeline.xctimeline
32 | playground.xcworkspace
33 |
34 | # Swift Package Manager
35 | #
36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37 | # Packages/
38 | .build/
39 |
40 | # CocoaPods
41 | #
42 | # We recommend against adding the Pods directory to your .gitignore. However
43 | # you should judge for yourself, the pros and cons are mentioned at:
44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
45 | #
46 | # Pods/
47 |
48 | # Carthage
49 | #
50 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
51 | # Carthage/Checkouts
52 |
53 | Carthage/Build
54 |
55 | # fastlane
56 | #
57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
58 | # screenshots whenever they are needed.
59 | # For more information about the recommended setup visit:
60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
61 |
62 | fastlane/report.xml
63 | fastlane/screenshots
64 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/GameViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GameViewController.swift
3 | // GameDoneSwift
4 | //
5 | // Created by Kyle Craig on 1/29/16.
6 | // Copyright (c) 2016 IBM MIL. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SpriteKit
11 |
12 | class GameViewController: UIViewController {
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | if let scene = GameScene(fileNamed:"GameScene") {
18 | // Configure the view.
19 | let skView = self.view as! SKView
20 | skView.showsFPS = true
21 | skView.showsNodeCount = true
22 |
23 | /* Sprite Kit applies additional optimizations to improve rendering performance */
24 | skView.ignoresSiblingOrder = true
25 |
26 | /* Set the scale mode to scale to fit the window */
27 | scene.scaleMode = .aspectFill
28 |
29 | scene.sceneController = self
30 |
31 | skView.presentScene(scene)
32 | }
33 | }
34 |
35 | override var shouldAutorotate : Bool {
36 | return true
37 | }
38 |
39 | override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
40 | if UIDevice.current.userInterfaceIdiom == .phone {
41 | return .allButUpsideDown
42 | } else {
43 | return .all
44 | }
45 | }
46 |
47 | override func didReceiveMemoryWarning() {
48 | super.didReceiveMemoryWarning()
49 | // Release any cached data, images, etc that aren't in use.
50 | }
51 |
52 | override var prefersStatusBarHidden : Bool {
53 | return true
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // GameDoneSwift
4 | //
5 | // Created by Kyle Craig on 1/29/16.
6 | // Copyright © 2016 IBM MIL. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GameDoneSwift
2 |
3 | Welcome to *GameDoneSwift*! Our first project tutorial on github!
4 |
5 | ## How This Works
6 |
7 | All the branches in this repo are set up as different sections of a tutorial series with the final
8 | product of creating a basic game in swift. The branches are as follows:
9 |
10 | 1. [Brand-New-Project](https://github.com/IBM-MIL/GameDoneSwift/tree/Brand-New-Project)
11 | - Where to go if you want to start the whole journey from the beginning.
12 | 2. [Reticulating-Splines](https://github.com/IBM-MIL/GameDoneSwift/tree/Reticulating-Splines)
13 | - Details how to setup and link the game scene.
14 | 3. [Lets-Get-Physical](https://github.com/IBM-MIL/GameDoneSwift/tree/Lets-Get-Physical)
15 | - Setting up the physics of the game.
16 | 4. [As-The-World-Turns](https://github.com/IBM-MIL/GameDoneSwift/tree/As-The-World-Turns)
17 | - Generating random infinite content.
18 | 5. [Game-Over](https://github.com/IBM-MIL/GameDoneSwift/tree/Game-Over)
19 | - Adding final touches like music and reset.
20 |
21 | This branch (master) contains the full completed game.
22 |
23 | ## What To Expect
24 |
25 | A simple introduction on how to use SpriteKit and Swift. Some basic Swift features such as `guard`
26 | statements and `do-try-catch` blocks will be used throughout the tutorial. You'll also learn
27 | the basics of the SpriteKit physics engine and how to add physics bodies to your sprites. The
28 | SpriteKit scene editor will be used, and instructions on how to set up a game scene using it will
29 | be detailed. We'll also give a very basic explanation on how game scenes work.
30 |
31 | ## What Not To Expect
32 |
33 | In general the code was written to be easy to follow, so a lot of higher level functionality available
34 | in Swift, iOS, and even SpriteKit won't be used. This also means that all code won't be optimized or
35 | written as modualar as possible (seriously, `GameScene.swift` gets pretty large by the end).
36 | Functions are seperated out in a logical way, but not necessarily the way they would be for a
37 | release candidate project. It is also assumed that you know how to use git. We don't plan on teaching
38 | how to navigate branches. If any of this bothers you, this probably isn't the tutorial you're
39 | looking for.
40 |
41 | However, if all you want is a quick and dirty dive into SpriteKit then welcome aboard! You can start
42 | the tutorial over in the [Brand-New-Project](https://github.com/IBM-MIL/GameDoneSwift/tree/Brand-New-Project)
43 | branch.
44 |
45 | ## Time To Complete
46 |
47 | Depending on how serious you take the tutorial, it should only take ~1 hour from start to finish.
48 |
49 | ## Credits
50 |
51 | - *Author:* Kyle Craig
52 | - *Co-Author and Tester:* Evan Compton
53 | - *Music:* Evan Compton
54 | - *Unicorn:* Jacob Cummings
55 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift/GameScene.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GameScene.swift
3 | // GameDoneSwift
4 | //
5 | // Created by Kyle Craig on 1/29/16.
6 | // Copyright (c) 2016 IBM MIL. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 | import AVFoundation
11 |
12 | class GameScene: SKScene {
13 |
14 | let kingSpriteName = "king"
15 | let groundSpriteName = "ground"
16 | let backgroundSpriteName = "background"
17 |
18 | var king: SKSpriteNode!
19 | var ground: SKSpriteNode!
20 | var background: SKSpriteNode!
21 |
22 | var onGround = true
23 |
24 | var backgrounds: [SKSpriteNode] = []
25 |
26 | let backgroundTime: CFTimeInterval = 1.0
27 | var previousTime: CFTimeInterval = 0
28 | var backgroundTimeCount: CFTimeInterval = 0
29 |
30 | var platforms: [SKShapeNode] = []
31 |
32 | // Platform Configuration
33 | let platformStartX: CGFloat = 2900.0
34 | let platformHeight: CGFloat = 100.0
35 | let minPlatformWidth: UInt32 = 100
36 | let platformMaxWidthChange: UInt32 = 700
37 | let minPlatformY: UInt32 = 200
38 | let platformMaxYChange: UInt32 = 200
39 | let platformSpacing: CGFloat = 450.0
40 |
41 | let platformTime: CFTimeInterval = 0.5
42 | var platformTimeCount: CFTimeInterval = 0
43 |
44 | var player: AVAudioPlayer!
45 |
46 | var sceneController: GameViewController!
47 | var score = 0
48 |
49 | override func didMove(to view: SKView) {
50 | /* Setup your scene here */
51 | guard let king = self.childNode(withName: kingSpriteName) as? SKSpriteNode,
52 | let ground = self.childNode(withName: groundSpriteName) as? SKSpriteNode,
53 | let background = self.childNode(withName: backgroundSpriteName) as? SKSpriteNode
54 | else {
55 | print("Sprites not found.")
56 | return
57 | }
58 |
59 | self.king = king
60 | self.ground = ground
61 | self.background = background
62 |
63 | setPhysicsBitMasks()
64 | self.physicsWorld.contactDelegate = self
65 |
66 | backgrounds.append(self.background)
67 | addNextBG()
68 |
69 | do {
70 | let sickBeats = URL(fileURLWithPath: Bundle.main.path(forResource: "sickBeats", ofType: "mp3")!)
71 | player = try AVAudioPlayer(contentsOf: sickBeats)
72 | player.numberOfLoops = -1
73 | player.play()
74 | } catch {
75 | print("Failed to load audio.")
76 | }
77 |
78 | }
79 |
80 | override func touchesBegan(_ touches: Set, with event: UIEvent?) {
81 | /* Called when a touch begins */
82 | jump()
83 | }
84 |
85 | override func update(_ currentTime: TimeInterval) {
86 | /* Called before each frame is rendered */
87 | platformTimeCount += currentTime - previousTime
88 |
89 | if platformTimeCount > platformTime {
90 | self.addPlatform()
91 | platformTimeCount = 0
92 | }
93 | backgroundTimeCount += currentTime - previousTime
94 |
95 | if backgroundTimeCount > backgroundTime {
96 | self.addNextBG()
97 | backgroundTimeCount = 0
98 | }
99 |
100 | previousTime = currentTime
101 |
102 |
103 | }
104 |
105 | override func didFinishUpdate() {
106 | /* Called after each update */
107 |
108 | movePlayer()
109 | if king.position.y < -200 {
110 | gameOver()
111 | }
112 | score += 1
113 | }
114 |
115 | func gameOver() {
116 | self.isPaused = true
117 | presentScore()
118 | }
119 |
120 | func presentScore() {
121 | let alert = UIAlertController(title: "Game Over!", message:"Your final score was \(score).", preferredStyle: .alert)
122 | alert.addAction(UIAlertAction(title: "Try Again!", style: .default) { _ in
123 | self.reset()
124 | })
125 | sceneController.present(alert, animated: true){}
126 |
127 | }
128 |
129 | func reset() {
130 | self.removeAllChildren()
131 | self.addChild(background)
132 | self.addChild(ground)
133 | self.addChild(king)
134 |
135 | self.king.position = CGPoint(x: 200, y: 220)
136 | moveCameraWith(king, offset: 350)
137 |
138 | platforms = []
139 | backgrounds = []
140 | backgrounds.append(background)
141 | addNextBG()
142 |
143 | score = 0
144 |
145 | self.isPaused = false
146 | }
147 |
148 | func setPhysicsBitMasks() {
149 | /* Sets up the SKSpriteNode bit masks so they can interact in the physics engine */
150 |
151 | self.king.physicsBody?.categoryBitMask = PhysicsBitMasks.player
152 | self.king.physicsBody?.collisionBitMask = PhysicsBitMasks.ground
153 | self.king.physicsBody?.contactTestBitMask = PhysicsBitMasks.ground
154 |
155 | self.ground.physicsBody?.categoryBitMask = PhysicsBitMasks.ground
156 | self.ground.physicsBody?.collisionBitMask = PhysicsBitMasks.player
157 | self.ground.physicsBody?.contactTestBitMask = PhysicsBitMasks.player
158 |
159 | }
160 |
161 | func jump() {
162 | /* Applies a y velocity to the player character */
163 |
164 | if onGround {
165 | self.king.physicsBody?.applyImpulse(CGVector(dx: 200.0, dy: 1000.0))
166 | onGround = false
167 | }
168 |
169 | }
170 |
171 | func movePlayer() {
172 | /* Sets the x velocity of the player character */
173 |
174 | self.king.physicsBody?.velocity.dx = 1000.0
175 | moveCameraWith(self.king, offset: 350)
176 |
177 | }
178 |
179 | func moveCameraWith(_ node: SKNode, offset: CGFloat) {
180 | /* Moves the camera along the x-axis with a specified node and offset */
181 |
182 | guard let camera = self.camera else {
183 | print("No camera.")
184 | return
185 | }
186 |
187 | camera.position = CGPoint(x: node.position.x + offset, y: 375)
188 |
189 | }
190 |
191 | func addNextBG() {
192 | /* Adds a new background sprite to backgrounds. */
193 |
194 | let nextBG = SKSpriteNode(imageNamed: "background")
195 | nextBG.size = CGSize(width: 1920.0, height: 1080.0)
196 | nextBG.anchorPoint = CGPoint(x: 0.0, y: 0.0)
197 | nextBG.position.x = backgrounds.last!.position.x + backgrounds.last!.frame.width
198 |
199 | backgrounds.append(nextBG)
200 | addChild(nextBG)
201 | if backgrounds.count > 100 {
202 | backgrounds.first?.removeFromParent()
203 | backgrounds.removeFirst()
204 | }
205 |
206 | }
207 |
208 | func platformWithRect(_ rect: CGRect) -> SKShapeNode {
209 | /* Create a new platform node and its physics body. */
210 |
211 | let platform = SKShapeNode(rect: rect)
212 | platform.name = "platform"
213 | platform.fillColor = UIColor(red: 206/256, green: 229/256, blue: 139/256, alpha: 1.0)
214 | platform.zPosition = 1
215 |
216 | let center = CGPoint(x: platform.frame.origin.x + platform.frame.width/2, y: platform.frame.origin.y + platform.frame.height/2)
217 | platform.physicsBody = SKPhysicsBody(rectangleOf: rect.size, center: center)
218 | platform.physicsBody?.affectedByGravity = false
219 | platform.physicsBody?.allowsRotation = false
220 | platform.physicsBody?.isDynamic = false
221 | platform.physicsBody?.pinned = true
222 | platform.physicsBody?.categoryBitMask = PhysicsBitMasks.ground
223 | platform.physicsBody?.collisionBitMask = PhysicsBitMasks.player
224 | platform.physicsBody?.contactTestBitMask = PhysicsBitMasks.player
225 |
226 | return platform
227 |
228 | }
229 |
230 | func addPlatform() {
231 | /* Add a new platform to the game. */
232 |
233 | var x: CGFloat = platformStartX
234 | let y = CGFloat(arc4random_uniform(platformMaxYChange)+minPlatformY)
235 | let width = CGFloat(arc4random_uniform(platformMaxWidthChange)+minPlatformWidth)
236 |
237 | if platforms.count > 0 {
238 | let previous = platforms.last!
239 | x = previous.frame.origin.x + previous.frame.width + platformSpacing
240 | }
241 |
242 | let rect = CGRect(x: x, y: y, width: width, height: platformHeight)
243 |
244 | let platform = platformWithRect(rect)
245 |
246 | platforms.append(platform)
247 | addChild(platform)
248 | if platforms.count > 150 {
249 | platforms.first?.removeFromParent()
250 | platforms.removeFirst()
251 | }
252 |
253 | }
254 |
255 | }
256 |
257 | extension GameScene: SKPhysicsContactDelegate {
258 |
259 | func didBegin(_ contact: SKPhysicsContact) {
260 | /* Fires when contact is made between two physics bodies with collision bit masks */
261 | onGround = true
262 |
263 | }
264 |
265 | }
266 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/GameDoneSwift-iPhone/GameDoneSwift.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 81A037A91C652FA100886024 /* PhysicsBitMasks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A037A81C652FA100886024 /* PhysicsBitMasks.swift */; };
11 | 81A037AB1C65795500886024 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81A037AA1C65795500886024 /* AVFoundation.framework */; };
12 | 81A037AD1C65797C00886024 /* sickBeats.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 81A037AC1C65797C00886024 /* sickBeats.mp3 */; };
13 | D47C37341C5BC484008221B8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D47C37331C5BC484008221B8 /* AppDelegate.swift */; };
14 | D47C37361C5BC484008221B8 /* GameScene.sks in Resources */ = {isa = PBXBuildFile; fileRef = D47C37351C5BC484008221B8 /* GameScene.sks */; };
15 | D47C37381C5BC484008221B8 /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = D47C37371C5BC484008221B8 /* GameScene.swift */; };
16 | D47C373A1C5BC484008221B8 /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D47C37391C5BC484008221B8 /* GameViewController.swift */; };
17 | D47C373D1C5BC484008221B8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D47C373B1C5BC484008221B8 /* Main.storyboard */; };
18 | D47C373F1C5BC484008221B8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D47C373E1C5BC484008221B8 /* Assets.xcassets */; };
19 | D47C37421C5BC484008221B8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D47C37401C5BC484008221B8 /* LaunchScreen.storyboard */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXFileReference section */
23 | 81A037A81C652FA100886024 /* PhysicsBitMasks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PhysicsBitMasks.swift; path = GameDoneSwift/PhysicsBitMasks.swift; sourceTree = ""; };
24 | 81A037AA1C65795500886024 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
25 | 81A037AC1C65797C00886024 /* sickBeats.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = sickBeats.mp3; sourceTree = ""; };
26 | D47C37301C5BC484008221B8 /* GameDoneSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GameDoneSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
27 | D47C37331C5BC484008221B8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
28 | D47C37351C5BC484008221B8 /* GameScene.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = GameScene.sks; sourceTree = ""; };
29 | D47C37371C5BC484008221B8 /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = ""; };
30 | D47C37391C5BC484008221B8 /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = ""; };
31 | D47C373C1C5BC484008221B8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
32 | D47C373E1C5BC484008221B8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
33 | D47C37411C5BC484008221B8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
34 | D47C37431C5BC484008221B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | D47C372D1C5BC484008221B8 /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | 81A037AB1C65795500886024 /* AVFoundation.framework in Frameworks */,
43 | );
44 | runOnlyForDeploymentPostprocessing = 0;
45 | };
46 | /* End PBXFrameworksBuildPhase section */
47 |
48 | /* Begin PBXGroup section */
49 | D47C37271C5BC484008221B8 = {
50 | isa = PBXGroup;
51 | children = (
52 | 81A037AA1C65795500886024 /* AVFoundation.framework */,
53 | 81A037A81C652FA100886024 /* PhysicsBitMasks.swift */,
54 | D47C37321C5BC484008221B8 /* GameDoneSwift */,
55 | D47C37311C5BC484008221B8 /* Products */,
56 | );
57 | sourceTree = "";
58 | };
59 | D47C37311C5BC484008221B8 /* Products */ = {
60 | isa = PBXGroup;
61 | children = (
62 | D47C37301C5BC484008221B8 /* GameDoneSwift.app */,
63 | );
64 | name = Products;
65 | sourceTree = "";
66 | };
67 | D47C37321C5BC484008221B8 /* GameDoneSwift */ = {
68 | isa = PBXGroup;
69 | children = (
70 | 81A037AC1C65797C00886024 /* sickBeats.mp3 */,
71 | D47C37331C5BC484008221B8 /* AppDelegate.swift */,
72 | D47C37351C5BC484008221B8 /* GameScene.sks */,
73 | D47C37371C5BC484008221B8 /* GameScene.swift */,
74 | D47C37391C5BC484008221B8 /* GameViewController.swift */,
75 | D47C373B1C5BC484008221B8 /* Main.storyboard */,
76 | D47C373E1C5BC484008221B8 /* Assets.xcassets */,
77 | D47C37401C5BC484008221B8 /* LaunchScreen.storyboard */,
78 | D47C37431C5BC484008221B8 /* Info.plist */,
79 | );
80 | path = GameDoneSwift;
81 | sourceTree = "";
82 | };
83 | /* End PBXGroup section */
84 |
85 | /* Begin PBXNativeTarget section */
86 | D47C372F1C5BC484008221B8 /* GameDoneSwift */ = {
87 | isa = PBXNativeTarget;
88 | buildConfigurationList = D47C37461C5BC484008221B8 /* Build configuration list for PBXNativeTarget "GameDoneSwift" */;
89 | buildPhases = (
90 | D47C372C1C5BC484008221B8 /* Sources */,
91 | D47C372D1C5BC484008221B8 /* Frameworks */,
92 | D47C372E1C5BC484008221B8 /* Resources */,
93 | );
94 | buildRules = (
95 | );
96 | dependencies = (
97 | );
98 | name = GameDoneSwift;
99 | productName = GameDoneSwift;
100 | productReference = D47C37301C5BC484008221B8 /* GameDoneSwift.app */;
101 | productType = "com.apple.product-type.application";
102 | };
103 | /* End PBXNativeTarget section */
104 |
105 | /* Begin PBXProject section */
106 | D47C37281C5BC484008221B8 /* Project object */ = {
107 | isa = PBXProject;
108 | attributes = {
109 | LastSwiftUpdateCheck = 0720;
110 | LastUpgradeCheck = 0720;
111 | ORGANIZATIONNAME = "IBM MIL";
112 | TargetAttributes = {
113 | D47C372F1C5BC484008221B8 = {
114 | CreatedOnToolsVersion = 7.2;
115 | LastSwiftMigration = 0820;
116 | };
117 | };
118 | };
119 | buildConfigurationList = D47C372B1C5BC484008221B8 /* Build configuration list for PBXProject "GameDoneSwift" */;
120 | compatibilityVersion = "Xcode 3.2";
121 | developmentRegion = English;
122 | hasScannedForEncodings = 0;
123 | knownRegions = (
124 | en,
125 | Base,
126 | );
127 | mainGroup = D47C37271C5BC484008221B8;
128 | productRefGroup = D47C37311C5BC484008221B8 /* Products */;
129 | projectDirPath = "";
130 | projectRoot = "";
131 | targets = (
132 | D47C372F1C5BC484008221B8 /* GameDoneSwift */,
133 | );
134 | };
135 | /* End PBXProject section */
136 |
137 | /* Begin PBXResourcesBuildPhase section */
138 | D47C372E1C5BC484008221B8 /* Resources */ = {
139 | isa = PBXResourcesBuildPhase;
140 | buildActionMask = 2147483647;
141 | files = (
142 | D47C37361C5BC484008221B8 /* GameScene.sks in Resources */,
143 | 81A037AD1C65797C00886024 /* sickBeats.mp3 in Resources */,
144 | D47C37421C5BC484008221B8 /* LaunchScreen.storyboard in Resources */,
145 | D47C373F1C5BC484008221B8 /* Assets.xcassets in Resources */,
146 | D47C373D1C5BC484008221B8 /* Main.storyboard in Resources */,
147 | );
148 | runOnlyForDeploymentPostprocessing = 0;
149 | };
150 | /* End PBXResourcesBuildPhase section */
151 |
152 | /* Begin PBXSourcesBuildPhase section */
153 | D47C372C1C5BC484008221B8 /* Sources */ = {
154 | isa = PBXSourcesBuildPhase;
155 | buildActionMask = 2147483647;
156 | files = (
157 | D47C37381C5BC484008221B8 /* GameScene.swift in Sources */,
158 | 81A037A91C652FA100886024 /* PhysicsBitMasks.swift in Sources */,
159 | D47C373A1C5BC484008221B8 /* GameViewController.swift in Sources */,
160 | D47C37341C5BC484008221B8 /* AppDelegate.swift in Sources */,
161 | );
162 | runOnlyForDeploymentPostprocessing = 0;
163 | };
164 | /* End PBXSourcesBuildPhase section */
165 |
166 | /* Begin PBXVariantGroup section */
167 | D47C373B1C5BC484008221B8 /* Main.storyboard */ = {
168 | isa = PBXVariantGroup;
169 | children = (
170 | D47C373C1C5BC484008221B8 /* Base */,
171 | );
172 | name = Main.storyboard;
173 | sourceTree = "";
174 | };
175 | D47C37401C5BC484008221B8 /* LaunchScreen.storyboard */ = {
176 | isa = PBXVariantGroup;
177 | children = (
178 | D47C37411C5BC484008221B8 /* Base */,
179 | );
180 | name = LaunchScreen.storyboard;
181 | sourceTree = "";
182 | };
183 | /* End PBXVariantGroup section */
184 |
185 | /* Begin XCBuildConfiguration section */
186 | D47C37441C5BC484008221B8 /* Debug */ = {
187 | isa = XCBuildConfiguration;
188 | buildSettings = {
189 | ALWAYS_SEARCH_USER_PATHS = NO;
190 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
191 | CLANG_CXX_LIBRARY = "libc++";
192 | CLANG_ENABLE_MODULES = YES;
193 | CLANG_ENABLE_OBJC_ARC = YES;
194 | CLANG_WARN_BOOL_CONVERSION = YES;
195 | CLANG_WARN_CONSTANT_CONVERSION = YES;
196 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
197 | CLANG_WARN_EMPTY_BODY = YES;
198 | CLANG_WARN_ENUM_CONVERSION = YES;
199 | CLANG_WARN_INT_CONVERSION = YES;
200 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
201 | CLANG_WARN_UNREACHABLE_CODE = YES;
202 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
203 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
204 | COPY_PHASE_STRIP = NO;
205 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
206 | ENABLE_STRICT_OBJC_MSGSEND = YES;
207 | ENABLE_TESTABILITY = YES;
208 | GCC_C_LANGUAGE_STANDARD = gnu99;
209 | GCC_DYNAMIC_NO_PIC = NO;
210 | GCC_NO_COMMON_BLOCKS = YES;
211 | GCC_OPTIMIZATION_LEVEL = 0;
212 | GCC_PREPROCESSOR_DEFINITIONS = (
213 | "DEBUG=1",
214 | "$(inherited)",
215 | );
216 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
217 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
218 | GCC_WARN_UNDECLARED_SELECTOR = YES;
219 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
220 | GCC_WARN_UNUSED_FUNCTION = YES;
221 | GCC_WARN_UNUSED_VARIABLE = YES;
222 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
223 | MTL_ENABLE_DEBUG_INFO = YES;
224 | ONLY_ACTIVE_ARCH = YES;
225 | SDKROOT = iphoneos;
226 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
227 | };
228 | name = Debug;
229 | };
230 | D47C37451C5BC484008221B8 /* Release */ = {
231 | isa = XCBuildConfiguration;
232 | buildSettings = {
233 | ALWAYS_SEARCH_USER_PATHS = NO;
234 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
235 | CLANG_CXX_LIBRARY = "libc++";
236 | CLANG_ENABLE_MODULES = YES;
237 | CLANG_ENABLE_OBJC_ARC = YES;
238 | CLANG_WARN_BOOL_CONVERSION = YES;
239 | CLANG_WARN_CONSTANT_CONVERSION = YES;
240 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
241 | CLANG_WARN_EMPTY_BODY = YES;
242 | CLANG_WARN_ENUM_CONVERSION = YES;
243 | CLANG_WARN_INT_CONVERSION = YES;
244 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
245 | CLANG_WARN_UNREACHABLE_CODE = YES;
246 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
247 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
248 | COPY_PHASE_STRIP = NO;
249 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
250 | ENABLE_NS_ASSERTIONS = NO;
251 | ENABLE_STRICT_OBJC_MSGSEND = YES;
252 | GCC_C_LANGUAGE_STANDARD = gnu99;
253 | GCC_NO_COMMON_BLOCKS = YES;
254 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
255 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
256 | GCC_WARN_UNDECLARED_SELECTOR = YES;
257 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
258 | GCC_WARN_UNUSED_FUNCTION = YES;
259 | GCC_WARN_UNUSED_VARIABLE = YES;
260 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
261 | MTL_ENABLE_DEBUG_INFO = NO;
262 | SDKROOT = iphoneos;
263 | VALIDATE_PRODUCT = YES;
264 | };
265 | name = Release;
266 | };
267 | D47C37471C5BC484008221B8 /* Debug */ = {
268 | isa = XCBuildConfiguration;
269 | buildSettings = {
270 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
271 | INFOPLIST_FILE = GameDoneSwift/Info.plist;
272 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
273 | PRODUCT_BUNDLE_IDENTIFIER = com.ibm.mil.GameDoneSwift;
274 | PRODUCT_NAME = "$(TARGET_NAME)";
275 | SWIFT_VERSION = 3.0;
276 | };
277 | name = Debug;
278 | };
279 | D47C37481C5BC484008221B8 /* Release */ = {
280 | isa = XCBuildConfiguration;
281 | buildSettings = {
282 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
283 | INFOPLIST_FILE = GameDoneSwift/Info.plist;
284 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
285 | PRODUCT_BUNDLE_IDENTIFIER = com.ibm.mil.GameDoneSwift;
286 | PRODUCT_NAME = "$(TARGET_NAME)";
287 | SWIFT_VERSION = 3.0;
288 | };
289 | name = Release;
290 | };
291 | /* End XCBuildConfiguration section */
292 |
293 | /* Begin XCConfigurationList section */
294 | D47C372B1C5BC484008221B8 /* Build configuration list for PBXProject "GameDoneSwift" */ = {
295 | isa = XCConfigurationList;
296 | buildConfigurations = (
297 | D47C37441C5BC484008221B8 /* Debug */,
298 | D47C37451C5BC484008221B8 /* Release */,
299 | );
300 | defaultConfigurationIsVisible = 0;
301 | defaultConfigurationName = Release;
302 | };
303 | D47C37461C5BC484008221B8 /* Build configuration list for PBXNativeTarget "GameDoneSwift" */ = {
304 | isa = XCConfigurationList;
305 | buildConfigurations = (
306 | D47C37471C5BC484008221B8 /* Debug */,
307 | D47C37481C5BC484008221B8 /* Release */,
308 | );
309 | defaultConfigurationIsVisible = 0;
310 | defaultConfigurationName = Release;
311 | };
312 | /* End XCConfigurationList section */
313 | };
314 | rootObject = D47C37281C5BC484008221B8 /* Project object */;
315 | }
316 |
--------------------------------------------------------------------------------