├── .gitignore
├── LICENSE.txt
├── Pac-Bar.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── Pac-Bar
├── AppDelegate.swift
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── PacMan 1024.png
│ │ ├── PacMan 128.png
│ │ ├── PacMan 16.png
│ │ ├── PacMan 256-1.png
│ │ ├── PacMan 256.png
│ │ ├── PacMan 32-1.png
│ │ ├── PacMan 32.png
│ │ ├── PacMan 512-1.png
│ │ ├── PacMan 512.png
│ │ └── PacMan 64.png
│ ├── Bars.spriteatlas
│ │ ├── Contents.json
│ │ ├── bar.imageset
│ │ │ ├── Contents.json
│ │ │ └── Pac-Bar.png
│ │ ├── barL.imageset
│ │ │ ├── Contents.json
│ │ │ └── barL.png
│ │ ├── barLs.imageset
│ │ │ ├── Contents.json
│ │ │ └── barLs.png
│ │ ├── barR.imageset
│ │ │ ├── Contents.json
│ │ │ └── barR.png
│ │ ├── bars.imageset
│ │ │ ├── Contents.json
│ │ │ └── bar4.png
│ │ ├── bbar.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbar.png
│ │ ├── bbarL.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbarL.png
│ │ ├── bbarLs.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbarLs.png
│ │ └── bbarR.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbarR.png
│ ├── Contents.json
│ ├── Dot.imageset
│ │ ├── Contents.json
│ │ └── Dot.png
│ ├── Pacman.spriteatlas
│ │ ├── Contents.json
│ │ ├── Pacman1.imageset
│ │ │ ├── Contents.json
│ │ │ └── Pacman1.png
│ │ ├── Pacman2.imageset
│ │ │ ├── Contents.json
│ │ │ └── Pacman2.png
│ │ └── Pacman3.imageset
│ │ │ ├── Contents.json
│ │ │ └── Pacman3.png
│ ├── bars-white.spriteatlas
│ │ ├── Contents.json
│ │ ├── barLsw.imageset
│ │ │ ├── Contents.json
│ │ │ └── barLs.png
│ │ ├── barLw.imageset
│ │ │ ├── Contents.json
│ │ │ └── barL.png
│ │ ├── barRw.imageset
│ │ │ ├── Contents.json
│ │ │ └── barR.png
│ │ ├── barsw.imageset
│ │ │ ├── Contents.json
│ │ │ └── bar4.png
│ │ ├── barw.imageset
│ │ │ ├── Contents.json
│ │ │ └── Pac-Bar.png
│ │ ├── bbarLsw.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbarLs.png
│ │ ├── bbarLw.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbarL.png
│ │ ├── bbarRw.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbarR.png
│ │ └── bbarw.imageset
│ │ │ ├── Contents.json
│ │ │ └── bbar.png
│ ├── blinky.spriteatlas
│ │ ├── BlinkyDown1.imageset
│ │ │ ├── BlinkyDown1.png
│ │ │ └── Contents.json
│ │ ├── BlinkyDown2.imageset
│ │ │ ├── BlinkyDown2.png
│ │ │ └── Contents.json
│ │ ├── BlinkySide1.imageset
│ │ │ ├── Blinky1.png
│ │ │ └── Contents.json
│ │ ├── BlinkySide2.imageset
│ │ │ ├── Blinky2.png
│ │ │ └── Contents.json
│ │ ├── BlinkyUp1.imageset
│ │ │ ├── BlinkyUp1.png
│ │ │ └── Contents.json
│ │ ├── BlinkyUp2.imageset
│ │ │ ├── BlinkyUp2.png
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── gameover.spriteatlas
│ │ ├── Contents.json
│ │ ├── gameover1.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD1.png
│ │ ├── gameover10.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD10.png
│ │ ├── gameover11.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD11.png
│ │ ├── gameover2.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD2.png
│ │ ├── gameover3.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD3.png
│ │ ├── gameover4.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD4.png
│ │ ├── gameover5.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD5.png
│ │ ├── gameover6.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD6.png
│ │ ├── gameover7.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD7.png
│ │ ├── gameover8.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD8.png
│ │ └── gameover9.imageset
│ │ │ ├── Contents.json
│ │ │ └── PacManD9.png
│ └── logo.imageset
│ │ ├── Contents.json
│ │ └── Pac-Bar Logo.png
├── Audio
│ ├── death.wav
│ ├── intro.wav
│ ├── munch A.wav
│ ├── munch B.wav
│ ├── siren fast.wav
│ ├── siren medium.wav
│ └── siren slow.wav
├── Definitions.swift
├── GameScene.swift
├── Info.plist
├── Main.storyboard
├── Sprite
│ ├── Blinky.swift
│ ├── PacMan.swift
│ └── Sprite.swift
├── ViewController.swift
└── WindowController.swift
├── README.md
└── Resources
├── General Sprites.png
├── Logo.svg
├── LogoFull.png
├── Pac-Bar Logo.png
├── Pac-Bar.piko
├── Pac-Bar.png
├── Space.piko
├── Text.png
├── Tunnels.png
├── pMan.piko
└── pMan.png
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | xcuserdata/
3 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Henry Franks
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Pac-Bar.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | F00A26B024FBFE0A00CFB895 /* Blinky.swift in Sources */ = {isa = PBXBuildFile; fileRef = F00A26AF24FBFE0A00CFB895 /* Blinky.swift */; };
11 | F00A26B224FBFE1300CFB895 /* PacMan.swift in Sources */ = {isa = PBXBuildFile; fileRef = F00A26B124FBFE1300CFB895 /* PacMan.swift */; };
12 | F03206ED23AA607B001CF3E9 /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = F03206EC23AA607B001CF3E9 /* GameScene.swift */; };
13 | F03206EF23AA633F001CF3E9 /* Definitions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F03206EE23AA633F001CF3E9 /* Definitions.swift */; };
14 | F050D7671DE4EF8600FA92BC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F050D7661DE4EF8600FA92BC /* Main.storyboard */; };
15 | F05465DB24FD7FFD00F4675C /* Sprite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05465DA24FD7FFD00F4675C /* Sprite.swift */; };
16 | F05C8E241DE35B7E00B5CCBC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05C8E231DE35B7E00B5CCBC /* AppDelegate.swift */; };
17 | F05C8E261DE35B7E00B5CCBC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05C8E251DE35B7E00B5CCBC /* ViewController.swift */; };
18 | F05C8E281DE35B7E00B5CCBC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F05C8E271DE35B7E00B5CCBC /* Assets.xcassets */; };
19 | F0AF962F2527C6E70037E9B7 /* munch B.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0AF96282527C6E70037E9B7 /* munch B.wav */; };
20 | F0AF96302527C6E70037E9B7 /* siren slow.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0AF96292527C6E70037E9B7 /* siren slow.wav */; };
21 | F0AF96312527C6E70037E9B7 /* siren medium.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0AF962A2527C6E70037E9B7 /* siren medium.wav */; };
22 | F0AF96322527C6E70037E9B7 /* munch A.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0AF962B2527C6E70037E9B7 /* munch A.wav */; };
23 | F0AF96332527C6E70037E9B7 /* intro.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0AF962C2527C6E70037E9B7 /* intro.wav */; };
24 | F0AF96342527C6E70037E9B7 /* siren fast.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0AF962D2527C6E70037E9B7 /* siren fast.wav */; };
25 | F0AF96352527C6E70037E9B7 /* death.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0AF962E2527C6E70037E9B7 /* death.wav */; };
26 | F0FC0E991DE36B550029C782 /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0FC0E981DE36B550029C782 /* WindowController.swift */; };
27 | /* End PBXBuildFile section */
28 |
29 | /* Begin PBXFileReference section */
30 | F00A26AF24FBFE0A00CFB895 /* Blinky.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Blinky.swift; sourceTree = ""; };
31 | F00A26B124FBFE1300CFB895 /* PacMan.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PacMan.swift; sourceTree = ""; };
32 | F03206EC23AA607B001CF3E9 /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = ""; };
33 | F03206EE23AA633F001CF3E9 /* Definitions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Definitions.swift; sourceTree = ""; };
34 | F050D7661DE4EF8600FA92BC /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; };
35 | F05465DA24FD7FFD00F4675C /* Sprite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sprite.swift; sourceTree = ""; };
36 | F05C8E201DE35B7E00B5CCBC /* Pac-Bar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Pac-Bar.app"; sourceTree = BUILT_PRODUCTS_DIR; };
37 | F05C8E231DE35B7E00B5CCBC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
38 | F05C8E251DE35B7E00B5CCBC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
39 | F05C8E271DE35B7E00B5CCBC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
40 | F05C8E2C1DE35B7E00B5CCBC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
41 | F0AF96282527C6E70037E9B7 /* munch B.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "munch B.wav"; sourceTree = ""; };
42 | F0AF96292527C6E70037E9B7 /* siren slow.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "siren slow.wav"; sourceTree = ""; };
43 | F0AF962A2527C6E70037E9B7 /* siren medium.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "siren medium.wav"; sourceTree = ""; };
44 | F0AF962B2527C6E70037E9B7 /* munch A.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "munch A.wav"; sourceTree = ""; };
45 | F0AF962C2527C6E70037E9B7 /* intro.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = intro.wav; sourceTree = ""; };
46 | F0AF962D2527C6E70037E9B7 /* siren fast.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "siren fast.wav"; sourceTree = ""; };
47 | F0AF962E2527C6E70037E9B7 /* death.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = death.wav; sourceTree = ""; };
48 | F0FC0E981DE36B550029C782 /* WindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = ""; };
49 | /* End PBXFileReference section */
50 |
51 | /* Begin PBXFrameworksBuildPhase section */
52 | F05C8E1D1DE35B7D00B5CCBC /* Frameworks */ = {
53 | isa = PBXFrameworksBuildPhase;
54 | buildActionMask = 2147483647;
55 | files = (
56 | );
57 | runOnlyForDeploymentPostprocessing = 0;
58 | };
59 | /* End PBXFrameworksBuildPhase section */
60 |
61 | /* Begin PBXGroup section */
62 | F05465DC24FD800E00F4675C /* Sprite */ = {
63 | isa = PBXGroup;
64 | children = (
65 | F00A26AF24FBFE0A00CFB895 /* Blinky.swift */,
66 | F00A26B124FBFE1300CFB895 /* PacMan.swift */,
67 | F05465DA24FD7FFD00F4675C /* Sprite.swift */,
68 | );
69 | path = Sprite;
70 | sourceTree = "";
71 | };
72 | F05C8E171DE35B7D00B5CCBC = {
73 | isa = PBXGroup;
74 | children = (
75 | F05C8E221DE35B7E00B5CCBC /* Pac-Bar */,
76 | F05C8E211DE35B7E00B5CCBC /* Products */,
77 | );
78 | sourceTree = "";
79 | };
80 | F05C8E211DE35B7E00B5CCBC /* Products */ = {
81 | isa = PBXGroup;
82 | children = (
83 | F05C8E201DE35B7E00B5CCBC /* Pac-Bar.app */,
84 | );
85 | name = Products;
86 | sourceTree = "";
87 | };
88 | F05C8E221DE35B7E00B5CCBC /* Pac-Bar */ = {
89 | isa = PBXGroup;
90 | children = (
91 | F05C8E231DE35B7E00B5CCBC /* AppDelegate.swift */,
92 | F03206EE23AA633F001CF3E9 /* Definitions.swift */,
93 | F05C8E251DE35B7E00B5CCBC /* ViewController.swift */,
94 | F0FC0E981DE36B550029C782 /* WindowController.swift */,
95 | F03206EC23AA607B001CF3E9 /* GameScene.swift */,
96 | F05465DC24FD800E00F4675C /* Sprite */,
97 | F05C8E2C1DE35B7E00B5CCBC /* Info.plist */,
98 | F050D7661DE4EF8600FA92BC /* Main.storyboard */,
99 | F05C8E271DE35B7E00B5CCBC /* Assets.xcassets */,
100 | F0AF96272527C6E70037E9B7 /* Audio */,
101 | );
102 | path = "Pac-Bar";
103 | sourceTree = "";
104 | };
105 | F0AF96272527C6E70037E9B7 /* Audio */ = {
106 | isa = PBXGroup;
107 | children = (
108 | F0AF96282527C6E70037E9B7 /* munch B.wav */,
109 | F0AF96292527C6E70037E9B7 /* siren slow.wav */,
110 | F0AF962A2527C6E70037E9B7 /* siren medium.wav */,
111 | F0AF962B2527C6E70037E9B7 /* munch A.wav */,
112 | F0AF962C2527C6E70037E9B7 /* intro.wav */,
113 | F0AF962D2527C6E70037E9B7 /* siren fast.wav */,
114 | F0AF962E2527C6E70037E9B7 /* death.wav */,
115 | );
116 | path = Audio;
117 | sourceTree = "";
118 | };
119 | /* End PBXGroup section */
120 |
121 | /* Begin PBXNativeTarget section */
122 | F05C8E1F1DE35B7D00B5CCBC /* Pac-Bar */ = {
123 | isa = PBXNativeTarget;
124 | buildConfigurationList = F05C8E451DE35B7E00B5CCBC /* Build configuration list for PBXNativeTarget "Pac-Bar" */;
125 | buildPhases = (
126 | F05C8E1C1DE35B7D00B5CCBC /* Sources */,
127 | F05C8E1D1DE35B7D00B5CCBC /* Frameworks */,
128 | F05C8E1E1DE35B7D00B5CCBC /* Resources */,
129 | );
130 | buildRules = (
131 | );
132 | dependencies = (
133 | );
134 | name = "Pac-Bar";
135 | productName = "Pac-Bar";
136 | productReference = F05C8E201DE35B7E00B5CCBC /* Pac-Bar.app */;
137 | productType = "com.apple.product-type.application";
138 | };
139 | /* End PBXNativeTarget section */
140 |
141 | /* Begin PBXProject section */
142 | F05C8E181DE35B7D00B5CCBC /* Project object */ = {
143 | isa = PBXProject;
144 | attributes = {
145 | LastSwiftUpdateCheck = 0810;
146 | LastUpgradeCheck = 1130;
147 | ORGANIZATIONNAME = "Henry Franks";
148 | TargetAttributes = {
149 | F05C8E1F1DE35B7D00B5CCBC = {
150 | CreatedOnToolsVersion = 8.1;
151 | DevelopmentTeam = 6K6QB4494B;
152 | LastSwiftMigration = 1130;
153 | ProvisioningStyle = Automatic;
154 | };
155 | };
156 | };
157 | buildConfigurationList = F05C8E1B1DE35B7D00B5CCBC /* Build configuration list for PBXProject "Pac-Bar" */;
158 | compatibilityVersion = "Xcode 3.2";
159 | developmentRegion = en;
160 | hasScannedForEncodings = 0;
161 | knownRegions = (
162 | en,
163 | Base,
164 | );
165 | mainGroup = F05C8E171DE35B7D00B5CCBC;
166 | productRefGroup = F05C8E211DE35B7E00B5CCBC /* Products */;
167 | projectDirPath = "";
168 | projectRoot = "";
169 | targets = (
170 | F05C8E1F1DE35B7D00B5CCBC /* Pac-Bar */,
171 | );
172 | };
173 | /* End PBXProject section */
174 |
175 | /* Begin PBXResourcesBuildPhase section */
176 | F05C8E1E1DE35B7D00B5CCBC /* Resources */ = {
177 | isa = PBXResourcesBuildPhase;
178 | buildActionMask = 2147483647;
179 | files = (
180 | F0AF96302527C6E70037E9B7 /* siren slow.wav in Resources */,
181 | F0AF96342527C6E70037E9B7 /* siren fast.wav in Resources */,
182 | F05C8E281DE35B7E00B5CCBC /* Assets.xcassets in Resources */,
183 | F050D7671DE4EF8600FA92BC /* Main.storyboard in Resources */,
184 | F0AF96312527C6E70037E9B7 /* siren medium.wav in Resources */,
185 | F0AF962F2527C6E70037E9B7 /* munch B.wav in Resources */,
186 | F0AF96332527C6E70037E9B7 /* intro.wav in Resources */,
187 | F0AF96352527C6E70037E9B7 /* death.wav in Resources */,
188 | F0AF96322527C6E70037E9B7 /* munch A.wav in Resources */,
189 | );
190 | runOnlyForDeploymentPostprocessing = 0;
191 | };
192 | /* End PBXResourcesBuildPhase section */
193 |
194 | /* Begin PBXSourcesBuildPhase section */
195 | F05C8E1C1DE35B7D00B5CCBC /* Sources */ = {
196 | isa = PBXSourcesBuildPhase;
197 | buildActionMask = 2147483647;
198 | files = (
199 | F05C8E261DE35B7E00B5CCBC /* ViewController.swift in Sources */,
200 | F0FC0E991DE36B550029C782 /* WindowController.swift in Sources */,
201 | F03206ED23AA607B001CF3E9 /* GameScene.swift in Sources */,
202 | F03206EF23AA633F001CF3E9 /* Definitions.swift in Sources */,
203 | F00A26B224FBFE1300CFB895 /* PacMan.swift in Sources */,
204 | F00A26B024FBFE0A00CFB895 /* Blinky.swift in Sources */,
205 | F05465DB24FD7FFD00F4675C /* Sprite.swift in Sources */,
206 | F05C8E241DE35B7E00B5CCBC /* AppDelegate.swift in Sources */,
207 | );
208 | runOnlyForDeploymentPostprocessing = 0;
209 | };
210 | /* End PBXSourcesBuildPhase section */
211 |
212 | /* Begin XCBuildConfiguration section */
213 | F05C8E431DE35B7E00B5CCBC /* Debug */ = {
214 | isa = XCBuildConfiguration;
215 | buildSettings = {
216 | ALWAYS_SEARCH_USER_PATHS = NO;
217 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
218 | CLANG_ANALYZER_NONNULL = YES;
219 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
220 | CLANG_CXX_LIBRARY = "libc++";
221 | CLANG_ENABLE_MODULES = YES;
222 | CLANG_ENABLE_OBJC_ARC = YES;
223 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
224 | CLANG_WARN_BOOL_CONVERSION = YES;
225 | CLANG_WARN_COMMA = YES;
226 | CLANG_WARN_CONSTANT_CONVERSION = YES;
227 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
228 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
229 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
230 | CLANG_WARN_EMPTY_BODY = YES;
231 | CLANG_WARN_ENUM_CONVERSION = YES;
232 | CLANG_WARN_INFINITE_RECURSION = YES;
233 | CLANG_WARN_INT_CONVERSION = YES;
234 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
235 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
236 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
237 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
238 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
239 | CLANG_WARN_STRICT_PROTOTYPES = YES;
240 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
241 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
242 | CLANG_WARN_UNREACHABLE_CODE = YES;
243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
244 | CODE_SIGN_IDENTITY = "-";
245 | COPY_PHASE_STRIP = NO;
246 | DEBUG_INFORMATION_FORMAT = dwarf;
247 | ENABLE_STRICT_OBJC_MSGSEND = YES;
248 | ENABLE_TESTABILITY = YES;
249 | GCC_C_LANGUAGE_STANDARD = gnu99;
250 | GCC_DYNAMIC_NO_PIC = NO;
251 | GCC_NO_COMMON_BLOCKS = YES;
252 | GCC_OPTIMIZATION_LEVEL = 0;
253 | GCC_PREPROCESSOR_DEFINITIONS = (
254 | "DEBUG=1",
255 | "$(inherited)",
256 | );
257 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
258 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
259 | GCC_WARN_UNDECLARED_SELECTOR = YES;
260 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
261 | GCC_WARN_UNUSED_FUNCTION = YES;
262 | GCC_WARN_UNUSED_VARIABLE = YES;
263 | MACOSX_DEPLOYMENT_TARGET = 10.12;
264 | MTL_ENABLE_DEBUG_INFO = YES;
265 | ONLY_ACTIVE_ARCH = YES;
266 | SDKROOT = macosx;
267 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
268 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
269 | };
270 | name = Debug;
271 | };
272 | F05C8E441DE35B7E00B5CCBC /* Release */ = {
273 | isa = XCBuildConfiguration;
274 | buildSettings = {
275 | ALWAYS_SEARCH_USER_PATHS = NO;
276 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
277 | CLANG_ANALYZER_NONNULL = YES;
278 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
279 | CLANG_CXX_LIBRARY = "libc++";
280 | CLANG_ENABLE_MODULES = YES;
281 | CLANG_ENABLE_OBJC_ARC = YES;
282 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
283 | CLANG_WARN_BOOL_CONVERSION = YES;
284 | CLANG_WARN_COMMA = YES;
285 | CLANG_WARN_CONSTANT_CONVERSION = YES;
286 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
287 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
288 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
289 | CLANG_WARN_EMPTY_BODY = YES;
290 | CLANG_WARN_ENUM_CONVERSION = YES;
291 | CLANG_WARN_INFINITE_RECURSION = YES;
292 | CLANG_WARN_INT_CONVERSION = YES;
293 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
294 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
295 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
296 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
297 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
298 | CLANG_WARN_STRICT_PROTOTYPES = YES;
299 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
300 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
301 | CLANG_WARN_UNREACHABLE_CODE = YES;
302 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
303 | CODE_SIGN_IDENTITY = "-";
304 | COPY_PHASE_STRIP = NO;
305 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
306 | ENABLE_NS_ASSERTIONS = NO;
307 | ENABLE_STRICT_OBJC_MSGSEND = YES;
308 | GCC_C_LANGUAGE_STANDARD = gnu99;
309 | GCC_NO_COMMON_BLOCKS = YES;
310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
312 | GCC_WARN_UNDECLARED_SELECTOR = YES;
313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
314 | GCC_WARN_UNUSED_FUNCTION = YES;
315 | GCC_WARN_UNUSED_VARIABLE = YES;
316 | MACOSX_DEPLOYMENT_TARGET = 10.12;
317 | MTL_ENABLE_DEBUG_INFO = NO;
318 | SDKROOT = macosx;
319 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
320 | };
321 | name = Release;
322 | };
323 | F05C8E461DE35B7E00B5CCBC /* Debug */ = {
324 | isa = XCBuildConfiguration;
325 | buildSettings = {
326 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
327 | CODE_SIGN_IDENTITY = "Mac Developer";
328 | COMBINE_HIDPI_IMAGES = YES;
329 | CURRENT_PROJECT_VERSION = 4R004;
330 | DEVELOPMENT_TEAM = 6K6QB4494B;
331 | ENABLE_HARDENED_RUNTIME = YES;
332 | INFOPLIST_FILE = "Pac-Bar/Info.plist";
333 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
334 | MARKETING_VERSION = 1.3;
335 | PRODUCT_BUNDLE_IDENTIFIER = "com.HenryFranks.Pac-Bar";
336 | PRODUCT_NAME = "$(TARGET_NAME)";
337 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
338 | SWIFT_VERSION = 5.0;
339 | };
340 | name = Debug;
341 | };
342 | F05C8E471DE35B7E00B5CCBC /* Release */ = {
343 | isa = XCBuildConfiguration;
344 | buildSettings = {
345 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
346 | CODE_SIGN_IDENTITY = "Mac Developer";
347 | COMBINE_HIDPI_IMAGES = YES;
348 | CURRENT_PROJECT_VERSION = 4R004;
349 | DEVELOPMENT_TEAM = 6K6QB4494B;
350 | ENABLE_HARDENED_RUNTIME = YES;
351 | INFOPLIST_FILE = "Pac-Bar/Info.plist";
352 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
353 | MARKETING_VERSION = 1.3;
354 | PRODUCT_BUNDLE_IDENTIFIER = "com.HenryFranks.Pac-Bar";
355 | PRODUCT_NAME = "$(TARGET_NAME)";
356 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
357 | SWIFT_VERSION = 5.0;
358 | };
359 | name = Release;
360 | };
361 | /* End XCBuildConfiguration section */
362 |
363 | /* Begin XCConfigurationList section */
364 | F05C8E1B1DE35B7D00B5CCBC /* Build configuration list for PBXProject "Pac-Bar" */ = {
365 | isa = XCConfigurationList;
366 | buildConfigurations = (
367 | F05C8E431DE35B7E00B5CCBC /* Debug */,
368 | F05C8E441DE35B7E00B5CCBC /* Release */,
369 | );
370 | defaultConfigurationIsVisible = 0;
371 | defaultConfigurationName = Release;
372 | };
373 | F05C8E451DE35B7E00B5CCBC /* Build configuration list for PBXNativeTarget "Pac-Bar" */ = {
374 | isa = XCConfigurationList;
375 | buildConfigurations = (
376 | F05C8E461DE35B7E00B5CCBC /* Debug */,
377 | F05C8E471DE35B7E00B5CCBC /* Release */,
378 | );
379 | defaultConfigurationIsVisible = 0;
380 | defaultConfigurationName = Release;
381 | };
382 | /* End XCConfigurationList section */
383 | };
384 | rootObject = F05C8E181DE35B7D00B5CCBC /* Project object */;
385 | }
386 |
--------------------------------------------------------------------------------
/Pac-Bar.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Pac-Bar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Pac-Bar/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 21/11/16.
6 | // Copyright © 2016 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 | func applicationShouldTerminateAfterLastWindowClosed(
14 | _ sender: NSApplication
15 | ) -> Bool {
16 | return true
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "PacMan 16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "PacMan 32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "PacMan 32-1.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "PacMan 64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "PacMan 128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "PacMan 256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "PacMan 256-1.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "PacMan 512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "PacMan 512-1.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "PacMan 1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 1024.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 128.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 16.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 256-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 256-1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 256.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 32-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 32-1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 32.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 512-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 512-1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 512.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/AppIcon.appiconset/PacMan 64.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bar.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Pac-Bar.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bar.imageset/Pac-Bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bar.imageset/Pac-Bar.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barL.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "barL.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barL.imageset/barL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barL.imageset/barL.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barLs.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "barLs.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barLs.imageset/barLs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barLs.imageset/barLs.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barR.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "barR.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barR.imageset/barR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/barR.imageset/barR.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bars.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bar4.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bars.imageset/bar4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bars.imageset/bar4.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbar.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbar.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbar.imageset/bbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbar.imageset/bbar.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarL.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbarL.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarL.imageset/bbarL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarL.imageset/bbarL.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarLs.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbarLs.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarLs.imageset/bbarLs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarLs.imageset/bbarLs.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarR.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbarR.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarR.imageset/bbarR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Bars.spriteatlas/bbarR.imageset/bbarR.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Dot.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Dot.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Dot.imageset/Dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Dot.imageset/Dot.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Pacman1.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman1.imageset/Pacman1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman1.imageset/Pacman1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Pacman2.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman2.imageset/Pacman2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman2.imageset/Pacman2.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Pacman3.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman3.imageset/Pacman3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/Pacman.spriteatlas/Pacman3.imageset/Pacman3.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barLsw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "barLs.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barLsw.imageset/barLs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barLsw.imageset/barLs.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barLw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "barL.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barLw.imageset/barL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barLw.imageset/barL.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barRw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "barR.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barRw.imageset/barR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barRw.imageset/barR.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barsw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bar4.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barsw.imageset/bar4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barsw.imageset/bar4.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Pac-Bar.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barw.imageset/Pac-Bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/barw.imageset/Pac-Bar.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarLsw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbarLs.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarLsw.imageset/bbarLs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarLsw.imageset/bbarLs.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarLw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbarL.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarLw.imageset/bbarL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarLw.imageset/bbarL.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarRw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbarR.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarRw.imageset/bbarR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarRw.imageset/bbarR.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarw.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bbar.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarw.imageset/bbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/bars-white.spriteatlas/bbarw.imageset/bbar.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyDown1.imageset/BlinkyDown1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyDown1.imageset/BlinkyDown1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyDown1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "BlinkyDown1.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyDown2.imageset/BlinkyDown2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyDown2.imageset/BlinkyDown2.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyDown2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "BlinkyDown2.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkySide1.imageset/Blinky1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkySide1.imageset/Blinky1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkySide1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Blinky1.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkySide2.imageset/Blinky2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkySide2.imageset/Blinky2.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkySide2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Blinky2.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyUp1.imageset/BlinkyUp1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyUp1.imageset/BlinkyUp1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyUp1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "BlinkyUp1.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyUp2.imageset/BlinkyUp2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyUp2.imageset/BlinkyUp2.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/BlinkyUp2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "BlinkyUp2.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/blinky.spriteatlas/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD1.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover1.imageset/PacManD1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover1.imageset/PacManD1.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover10.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD10.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover10.imageset/PacManD10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover10.imageset/PacManD10.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover11.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD11.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover11.imageset/PacManD11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover11.imageset/PacManD11.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD2.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover2.imageset/PacManD2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover2.imageset/PacManD2.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD3.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover3.imageset/PacManD3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover3.imageset/PacManD3.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover4.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD4.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover4.imageset/PacManD4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover4.imageset/PacManD4.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover5.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD5.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover5.imageset/PacManD5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover5.imageset/PacManD5.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover6.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD6.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover6.imageset/PacManD6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover6.imageset/PacManD6.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover7.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD7.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover7.imageset/PacManD7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover7.imageset/PacManD7.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover8.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD8.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover8.imageset/PacManD8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover8.imageset/PacManD8.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover9.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "PacManD9.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover9.imageset/PacManD9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/gameover.spriteatlas/gameover9.imageset/PacManD9.png
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Pac-Bar Logo.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 | }
--------------------------------------------------------------------------------
/Pac-Bar/Assets.xcassets/logo.imageset/Pac-Bar Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Assets.xcassets/logo.imageset/Pac-Bar Logo.png
--------------------------------------------------------------------------------
/Pac-Bar/Audio/death.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Audio/death.wav
--------------------------------------------------------------------------------
/Pac-Bar/Audio/intro.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Audio/intro.wav
--------------------------------------------------------------------------------
/Pac-Bar/Audio/munch A.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Audio/munch A.wav
--------------------------------------------------------------------------------
/Pac-Bar/Audio/munch B.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Audio/munch B.wav
--------------------------------------------------------------------------------
/Pac-Bar/Audio/siren fast.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Audio/siren fast.wav
--------------------------------------------------------------------------------
/Pac-Bar/Audio/siren medium.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Audio/siren medium.wav
--------------------------------------------------------------------------------
/Pac-Bar/Audio/siren slow.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Pac-Bar/Audio/siren slow.wav
--------------------------------------------------------------------------------
/Pac-Bar/Definitions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Definitions.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 18/12/2019.
6 | // Copyright © 2019 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | let POS_EPS: CGFloat = 0.5 // epsilon for position checking accuracy
12 | let SQUARE_SIZE: CGFloat = 14
13 |
14 | public var textField: NSTextField!
15 | public var highField: NSTextField!
16 |
17 | var counter: Int = 15 // To acount for awkwardness in controls
18 | var directionCache: Direction? = nil
19 |
20 | struct gamePhysics {
21 | static let PacMan: UInt32 = 1
22 | static let Dot: UInt32 = 2
23 | static let Blinky: UInt32 = 4
24 | }
25 |
26 | enum GameState {
27 | case introAnimation, playing, gameOverAnimation, waitingForRestart
28 | }
29 |
30 | protocol DetailsDelegate: class {
31 | func updateLabel(Score: Int)
32 | }
33 |
34 | var highScore: Int {
35 | set {
36 | UserDefaults.standard.set(newValue, forKey: "highScore")
37 | UserDefaults.standard.synchronize()
38 | }
39 |
40 | get {
41 | return UserDefaults.standard.object(forKey: "highScore") as? Int ?? 0
42 | }
43 | }
44 |
45 | let pacman = PacMan()
46 | let blinky = Blinky()
47 |
--------------------------------------------------------------------------------
/Pac-Bar/GameScene.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GameScene.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 18/12/2019.
6 | // Copyright © 2019 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import SpriteKit
11 | import GameplayKit
12 |
13 | var level: Int = 0
14 |
15 | class GameScene: SKScene, SKPhysicsContactDelegate {
16 |
17 | //Variables
18 | var state: GameState = .introAnimation
19 | var score: Int = 0
20 | var numDots = 85
21 | var barIsWhite: Bool = false
22 |
23 | // Sounds
24 | let introSound = SKAction.playSoundFileNamed(
25 | "intro.wav",
26 | waitForCompletion: false
27 | )
28 | let slowSiren = SKAction.playSoundFileNamed(
29 | "siren slow.wav",
30 | waitForCompletion: true
31 | )
32 | let mediumSiren = SKAction.playSoundFileNamed(
33 | "siren medium.wav",
34 | waitForCompletion: true
35 | )
36 | let fastSiren = SKAction.playSoundFileNamed(
37 | "siren fast.wav",
38 | waitForCompletion: true
39 | )
40 |
41 | //Creating stuff
42 | func createDots() {
43 | var dotArray = [SKSpriteNode]()
44 | for _ in 1...85 {
45 | dotArray.append(SKSpriteNode(imageNamed: "dot"))
46 | }
47 | var offsetX = 7
48 | for (index, item) in dotArray.enumerated() {
49 | item.position.x = CGFloat(offsetX)
50 | item.position.y = 15
51 | item.name = "Dot\(index)"
52 | item.physicsBody = SKPhysicsBody(rectangleOf: item.size)
53 | item.physicsBody?.categoryBitMask = gamePhysics.Dot
54 | item.physicsBody?.contactTestBitMask = gamePhysics.PacMan
55 | item.physicsBody?.isDynamic = true
56 | item.physicsBody?.affectedByGravity = false
57 | item.physicsBody?.collisionBitMask = 0
58 | self.addChild(item)
59 | offsetX += 8
60 | }
61 | level += 1
62 | }
63 |
64 | func createBorders() {
65 | var barArray = [SKSpriteNode]()
66 | barArray.append(SKSpriteNode(imageNamed: "barR"))
67 | barArray.append(SKSpriteNode(imageNamed: "bbarR"))
68 | barArray.append(SKSpriteNode(imageNamed: "barL"))
69 | barArray.append(SKSpriteNode(imageNamed: "bbarL"))
70 | barArray.append(SKSpriteNode(imageNamed: "barR"))
71 | barArray.append(SKSpriteNode(imageNamed: "bbarR"))
72 | for b in barArray {
73 | b.xScale = 1
74 | b.yScale = 1
75 | }
76 | var sArray = [SKSpriteNode]()
77 | sArray.append(SKSpriteNode(imageNamed: "barLs"))
78 | sArray.append(SKSpriteNode(imageNamed: "bbarLs"))
79 | var offsetX = 107
80 | var inc: Bool = false
81 | for (index, item) in barArray.enumerated() {
82 | item.name = "Bar" + "\(index)"
83 | item.position.x = CGFloat(offsetX)
84 | if inc {
85 | item.position.y = 2
86 | } else {
87 | item.position.y = 28
88 | }
89 | self.addChild(item)
90 | if inc {
91 | offsetX += 214
92 | }
93 | inc = !inc
94 | }
95 | for (index, item) in sArray.enumerated() {
96 | item.name = "Bar" + "\(index + 6)"
97 | item.position.x = 671
98 | if index == 0 {
99 | item.position.y = 28
100 | } else {
101 | item.position.y = 2
102 | }
103 | self.addChild(item)
104 | }
105 | }
106 |
107 | func createSprite(
108 | texture: [SKTexture],
109 | height: Int,
110 | width: Int,
111 | xPos: Int,
112 | yPos: Int,
113 | node: inout SKSpriteNode!,
114 | catBitMask: UInt32,
115 | conTestBitMask: [UInt32]
116 | ) {
117 | node = SKSpriteNode(texture: texture[0])
118 | node.size.height = CGFloat(height)
119 | node.size.width = CGFloat(width)
120 | node.position.x = CGFloat(xPos)
121 | node.position.y = CGFloat(yPos)
122 | node.physicsBody = SKPhysicsBody(rectangleOf: node.size)
123 | node.physicsBody?.categoryBitMask = catBitMask
124 | for mask in conTestBitMask {
125 | node.physicsBody?.contactTestBitMask = mask
126 | }
127 | node.physicsBody?.isDynamic = true
128 | node.physicsBody?.affectedByGravity = false
129 | self.addChild(node)
130 | }
131 |
132 | //Removing stuff
133 | func removeDot(dot: SKSpriteNode) {
134 | score += 10
135 | dot.removeFromParent()
136 | numDots -= 1
137 | updateScore(value: String(describing: score))
138 | pacman.playMunchSound()
139 | }
140 |
141 | func removeDots() {
142 | self.enumerateChildNodes(withName: "Dot" + "*", using: {
143 | (node, stop) -> Void in
144 | node.removeFromParent()
145 | })
146 | }
147 |
148 | func hideBars() {
149 | self.enumerateChildNodes(withName: "Bar" + "*", using: {
150 | (node, stop) -> Void in
151 | node.removeFromParent()
152 | })
153 | }
154 |
155 | func flashBars() {
156 | func isWhite() -> String {
157 | if barIsWhite {
158 | return ""
159 | }
160 | return "w"
161 | }
162 |
163 | self.enumerateChildNodes(withName: "Bar" + "*", using: {
164 | (node, stop) -> Void in
165 | let n = node as? SKSpriteNode
166 | switch n?.name {
167 | case "Bar0"?:
168 | n?.texture = SKTexture(imageNamed: "barR" + isWhite())
169 | case "Bar1"?:
170 | n?.texture = SKTexture(imageNamed: "bbarR" + isWhite())
171 | case "Bar2"?:
172 | n?.texture = SKTexture(imageNamed: "barL" + isWhite())
173 | case "Bar3"?:
174 | n?.texture = SKTexture(imageNamed: "bbarL" + isWhite())
175 | case "Bar4"?:
176 | n?.texture = SKTexture(imageNamed: "barR" + isWhite())
177 | case "Bar5"?:
178 | n?.texture = SKTexture(imageNamed: "bbarR" + isWhite())
179 | case "Bar6"?:
180 | n?.texture = SKTexture(imageNamed: "barLs" + isWhite())
181 | case "Bar7"?:
182 | n?.texture = SKTexture(imageNamed: "bbarLs" + isWhite())
183 | default:
184 | break
185 | }
186 | })
187 | barIsWhite = !barIsWhite
188 | }
189 |
190 | func flashAfterDelay(delay: Double) {
191 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + delay) {
192 | self.flashBars()
193 | }
194 | }
195 |
196 | func updateScore(value: String) {
197 | textField?.stringValue = value
198 | highField?.stringValue = "High Score: \(highScore)"
199 | }
200 |
201 | func didBegin(_ contact: SKPhysicsContact) {
202 | let firstBody: SKPhysicsBody = contact.bodyA
203 | let secondBody: SKPhysicsBody = contact.bodyB
204 |
205 | if firstBody.categoryBitMask == gamePhysics.PacMan &&
206 | secondBody.categoryBitMask == gamePhysics.Dot
207 | {
208 | removeDot(dot: secondBody.node as! SKSpriteNode)
209 | }
210 | else if firstBody.categoryBitMask == gamePhysics.PacMan &&
211 | secondBody.categoryBitMask == gamePhysics.Blinky
212 | {
213 | // game over
214 | self.state = .gameOverAnimation
215 |
216 | if score > highScore {
217 | highScore = score
218 | }
219 |
220 | self.view?.scene?.isPaused = true
221 | for action in ["slowSiren", "mediumSiren", "fastSiren"] {
222 | self.removeAction(forKey: action)
223 | }
224 |
225 | blinky.removeFromParent()
226 | self.removeDots()
227 |
228 | pacman.position.y -= 2
229 | pacman.removeAction(forKey: "PacManEat")
230 | pacman.texture = SKTexture(imageNamed: "Pacman3")
231 |
232 | blinky.removeFromParent()
233 |
234 | updateScore(value: String(describing: score) + "\n GAME OVER")
235 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) {
236 | self.view?.scene?.isPaused = false
237 | pacman.gameover()
238 | }
239 |
240 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2.1) {
241 | pacman.removeFromParent()
242 | self.state = .waitingForRestart
243 | self.view?.scene?.isPaused = true
244 | }
245 | }
246 | }
247 |
248 | //Initialise the game
249 | override func didMove(to view: SKView) {
250 | super.didMove(to: view)
251 |
252 | self.run(introSound)
253 |
254 | updateScore(value: "READY!")
255 |
256 | physicsWorld.contactDelegate = self
257 |
258 | createBorders()
259 | self.scaleMode = .resizeFill
260 | self.backgroundColor = .black
261 |
262 | self.addChild(pacman)
263 | self.addChild(blinky)
264 |
265 | pacman.texture = PacMan.eatFrames[2]
266 |
267 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 4.5) {
268 | self.createDots()
269 |
270 | pacman.run(
271 | SKAction.repeatForever(SKAction.animate(
272 | with: PacMan.eatFrames,
273 | timePerFrame: 0.05,
274 | resize: false,
275 | restore: true
276 | )),
277 | withKey: "PacManEat"
278 | )
279 | blinky.run(
280 | SKAction.repeatForever(SKAction.animate(
281 | with: Blinky.sideFrames,
282 | timePerFrame: 0.05,
283 | resize: false,
284 | restore: true
285 | )),
286 | withKey: "horizontalMove"
287 | )
288 |
289 | self.state = .playing
290 | self.run(
291 | SKAction.repeatForever(self.slowSiren),
292 | withKey: "slowSiren"
293 | )
294 | }
295 | }
296 |
297 | //Update everything (calls other functions)
298 | override func update(_ currentTime: TimeInterval) {
299 | if self.state == .playing {
300 | pacman.update()
301 | blinky.update()
302 |
303 | if numDots <= 10 && blinky.movementSpeed == .medium {
304 | blinky.movementSpeed = .fast
305 | self.removeAction(forKey: "mediumSiren")
306 | self.run(
307 | SKAction.repeatForever(self.fastSiren),
308 | withKey: "fastSiren"
309 | )
310 | } else if numDots <= 30 && blinky.movementSpeed == .slow {
311 | blinky.movementSpeed = .medium
312 | self.removeAction(forKey: "slowSiren")
313 | self.run(
314 | SKAction.repeatForever(self.mediumSiren),
315 | withKey: "mediumSiren"
316 | )
317 | }
318 |
319 | if counter > 0 {
320 | counter -= 1
321 |
322 | if directionCache != nil && pacman.yIsClose(to: 15) &&
323 | (pacman.xIsClose(to: 214) ||
324 | pacman.xIsClose(to: 642)) {
325 | pacman.updateDirection(to: directionCache!)
326 | counter = 0
327 | }
328 |
329 | if counter == 0 {
330 | directionCache = nil
331 | }
332 | }
333 |
334 | if numDots < 1 {
335 | self.view?.scene?.isPaused = true
336 |
337 | for action in ["slowSiren", "mediumSiren", "fastSiren"] {
338 | self.removeAction(forKey: action)
339 | }
340 |
341 | pacman.texture = SKTexture(imageNamed: "Pacman3")
342 |
343 | DispatchQueue.main.asyncAfter(
344 | deadline: DispatchTime.now() + 0.3)
345 | {
346 | blinky.removeFromParent()
347 |
348 | for i in 1...8 {
349 | self.flashAfterDelay(delay: Double(i) * 0.2)
350 | }
351 | }
352 |
353 | DispatchQueue.main.asyncAfter(
354 | deadline: DispatchTime.now() + 2.3)
355 | {
356 | pacman.removeFromParent()
357 | self.hideBars()
358 | }
359 |
360 | DispatchQueue.main.asyncAfter(
361 | deadline: DispatchTime.now() + 2.4)
362 | {
363 | self.addChild(pacman)
364 | pacman.position = CGPoint(x: 300, y: 15)
365 |
366 | self.createBorders()
367 |
368 | self.addChild(blinky)
369 | blinky.position = CGPoint(x: 50, y: 15)
370 | blinky.movementSpeed = .slow
371 | }
372 |
373 | DispatchQueue.main.asyncAfter(
374 | deadline: DispatchTime.now() + 2.6)
375 | {
376 | self.numDots = 85
377 | self.createDots()
378 | self.view?.scene?.isPaused = false
379 |
380 | self.run(
381 | SKAction.repeatForever(self.slowSiren),
382 | withKey: "slowSiren"
383 | )
384 | }
385 | }
386 | }
387 | }
388 | }
389 |
--------------------------------------------------------------------------------
/Pac-Bar/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(MARKETING_VERSION)
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | LSApplicationCategoryType
24 | public.app-category.arcade-games
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2016-2020 Henry Franks. All rights reserved.
29 | NSMainStoryboardFile
30 | Main
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Pac-Bar/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 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/Pac-Bar/Sprite/Blinky.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Blinky.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 30/08/2020.
6 | // Copyright © 2020 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import SpriteKit
11 |
12 | class Blinky: Sprite {
13 | static let atlas = SKTextureAtlas(named: "blinky")
14 |
15 | private var canChangeDirection: Bool = true
16 |
17 | static let sideFrames = [
18 | Blinky.atlas.textureNamed("BlinkySide1"),
19 | Blinky.atlas.textureNamed("BlinkySide2")
20 | ]
21 |
22 | static let upFrames = [
23 | Blinky.atlas.textureNamed("BlinkyUp1"),
24 | Blinky.atlas.textureNamed("BlinkyUp2")
25 | ]
26 |
27 | static let downFrames = [
28 | Blinky.atlas.textureNamed("BlinkyDown1"),
29 | Blinky.atlas.textureNamed("BlinkyDown2")
30 | ]
31 |
32 | enum MovementSpeed {
33 | case slow, medium, fast
34 | }
35 |
36 | var movementSpeed: MovementSpeed = .slow
37 |
38 | init() {
39 | let size = CGSize(width: 14, height: 14)
40 | let physicsBody = SKPhysicsBody(rectangleOf: size)
41 |
42 | physicsBody.categoryBitMask = gamePhysics.Blinky
43 |
44 | physicsBody.contactTestBitMask = gamePhysics.PacMan
45 |
46 | physicsBody.collisionBitMask = 0
47 |
48 | physicsBody.isDynamic = true
49 | physicsBody.affectedByGravity = false
50 |
51 | super.init(
52 | position: CGPoint(x: 50, y: 15),
53 | size: size,
54 | texture: Blinky.sideFrames[0],
55 | physicsBody: physicsBody,
56 | direction: .right
57 | )
58 |
59 | self.zPosition = 4
60 | }
61 |
62 | required init?(coder aDecoder: NSCoder) {
63 | // TODO: Does this need a proper implementation?
64 | super.init(coder: aDecoder)
65 | }
66 |
67 | override func update() {
68 | super.update()
69 |
70 | // switch direction at corners
71 | if self.yIsClose(to: 15) && (
72 | self.xIsClose(to: 214) || self.xIsClose(to: 642)
73 | ) {
74 | if self.canChangeDirection {
75 | self.canChangeDirection = false
76 | let newDirection = self.findShortestPath()
77 | if newDirection != self.direction {
78 | self.changeDirection(to: newDirection)
79 | }
80 | }
81 | } else { self.canChangeDirection = true }
82 |
83 | var speed: CGFloat = 1
84 |
85 | // increase speed when we've eaten enough dots
86 | if self.movementSpeed == .medium {
87 | speed *= 1.05
88 | } else if self.movementSpeed == .fast {
89 | speed *= 1.05 * 1.05
90 | }
91 |
92 | // decrease speed in tunnels
93 | if (self.position.x < 50 || self.position.y > 650 ||
94 | self.position.y < 14 || self.position.y > 16) {
95 | speed -= 0.1
96 | }
97 |
98 | if level > 10 {
99 | speed *= 1.05
100 | }
101 | if level > 15 {
102 | speed *= 1.05
103 | }
104 | if level > 20 {
105 | speed *= 1.05
106 | }
107 |
108 |
109 | switch self.direction {
110 | case .up:
111 | self.position.y += speed
112 | case.down:
113 | self.position.y -= speed
114 | case .left:
115 | self.position.x -= speed
116 | case .right:
117 | self.position.x += speed
118 | }
119 | }
120 |
121 | private func findShortestPath() -> Direction {
122 | var distances = [CGFloat]() // up, left, down, right
123 |
124 | let blinkySquare = self.currentSquare()
125 | let pacmanSquare = pacman.currentSquare()
126 |
127 | let xDifferenceSqr = pow(blinkySquare.x - pacmanSquare.x, 2)
128 | let yDifferenceSqr = pow(blinkySquare.y - pacmanSquare.y, 2)
129 |
130 | let rightDifferenceSqr = pow((blinkySquare.x + 1) - pacmanSquare.x, 2)
131 | let leftDifferenceSqr = pow((blinkySquare.x - 1) - pacmanSquare.x, 2)
132 | let upDifferenceSqr = pow((blinkySquare.y + 1) - pacmanSquare.y, 2)
133 | let downDifferenceSqr = pow((blinkySquare.y - 1) - pacmanSquare.y, 2)
134 |
135 | switch self.direction {
136 | case .up:
137 | distances = [
138 | xDifferenceSqr + upDifferenceSqr,
139 | -1.0,
140 | yDifferenceSqr + leftDifferenceSqr,
141 | yDifferenceSqr + rightDifferenceSqr
142 | ]
143 | case .down:
144 | distances = [
145 | -1.0,
146 | xDifferenceSqr + downDifferenceSqr,
147 | yDifferenceSqr + leftDifferenceSqr,
148 | yDifferenceSqr + rightDifferenceSqr
149 | ]
150 | case .left:
151 | distances = [
152 | xDifferenceSqr + upDifferenceSqr,
153 | xDifferenceSqr + downDifferenceSqr,
154 | yDifferenceSqr + leftDifferenceSqr,
155 | -1.0
156 | ]
157 | case .right:
158 | distances = [
159 | xDifferenceSqr + upDifferenceSqr,
160 | xDifferenceSqr + downDifferenceSqr,
161 | -1.0,
162 | yDifferenceSqr + rightDifferenceSqr
163 | ]
164 | }
165 |
166 | var minDistance: CGFloat = distances[0]
167 | var directionIndex: Int = 0
168 |
169 | for (index, distance) in distances.enumerated() {
170 | if minDistance < 0 || (distance >= 0 && distance < minDistance) {
171 | minDistance = distance
172 | directionIndex = index
173 | }
174 | }
175 |
176 | return [.up, .down, .left, .right][directionIndex]
177 | }
178 |
179 | private func changeDirection(to newDirection: Direction) {
180 | switch newDirection {
181 | case .up:
182 | if self.action(forKey: "moveHorizontal") != nil {
183 | self.removeAction(forKey: "moveHorizontal")
184 | }
185 | else if self.action(forKey: "moveDown") != nil {
186 | self.removeAction(forKey: "moveDown")
187 | }
188 |
189 | if self.action(forKey: "moveUp") == nil {
190 | self.run(
191 | SKAction.repeatForever(SKAction.animate(
192 | with: Blinky.upFrames,
193 | timePerFrame: 0.05,
194 | resize: false,
195 | restore: true
196 | )),
197 | withKey: "moveUp"
198 | )
199 | }
200 | if self.xIsClose(to: 214) {
201 | self.position.x = 214
202 | } else {
203 | self.position.x = 642
204 | }
205 | case .down:
206 | if self.action(forKey: "moveHorizontal") != nil {
207 | self.removeAction(forKey: "moveHorizontal")
208 | }
209 | else if self.action(forKey: "moveUp") != nil {
210 | self.removeAction(forKey: "moveUp")
211 | }
212 |
213 | if self.action(forKey: "moveDown") == nil {
214 | self.run(
215 | SKAction.repeatForever(SKAction.animate(
216 | with: Blinky.downFrames,
217 | timePerFrame: 0.05,
218 | resize: false,
219 | restore: true
220 | )),
221 | withKey: "moveDown"
222 | )
223 | }
224 | if self.xIsClose(to: 214) {
225 | self.position.x = 214
226 | } else {
227 | self.position.x = 642
228 | }
229 | case .left, .right:
230 | if self.action(forKey: "moveUp") != nil {
231 | self.removeAction(forKey: "moveUp")
232 | }
233 | else if self.action(forKey: "moveDown") != nil {
234 | self.removeAction(forKey: "moveDown")
235 | }
236 |
237 | if self.action(forKey: "moveHorizontal") == nil {
238 | self.run(
239 | SKAction.repeatForever(SKAction.animate(
240 | with: Blinky.sideFrames,
241 | timePerFrame: 0.05,
242 | resize: false,
243 | restore: true
244 | )),
245 | withKey: "moveHorizontal"
246 | )
247 | }
248 | self.position.y = 15
249 | if newDirection == .right {
250 | self.xScale = 1
251 | } else {
252 | self.xScale = -1
253 | }
254 | }
255 |
256 | self.direction = newDirection
257 | }
258 | }
259 |
--------------------------------------------------------------------------------
/Pac-Bar/Sprite/PacMan.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PacMan.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 30/08/2020.
6 | // Copyright © 2020 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import SpriteKit
11 |
12 | class PacMan: Sprite {
13 |
14 | private enum DotSoundABState {
15 | case A, B
16 | }
17 |
18 | private var munchAB: DotSoundABState = .A
19 |
20 | // sounds
21 | static let munchA = SKAction.playSoundFileNamed(
22 | "munch A.wav",
23 | waitForCompletion: false
24 | )
25 |
26 | static let munchB = SKAction.playSoundFileNamed(
27 | "munch B.wav",
28 | waitForCompletion: false
29 | )
30 |
31 | static let gameOverSound = SKAction.playSoundFileNamed(
32 | "death.wav",
33 | waitForCompletion: false
34 | )
35 |
36 | // graphics
37 | static let eatAtlas = SKTextureAtlas(named: "pacman")
38 |
39 | static let eatFrames = [
40 | PacMan.eatAtlas.textureNamed("PacMan1"),
41 | PacMan.eatAtlas.textureNamed("PacMan2"),
42 | PacMan.eatAtlas.textureNamed("PacMan3")
43 | ]
44 |
45 | static let gameoverAtlas = SKTextureAtlas(named: "gameover")
46 |
47 | static let gameoverFrames = [
48 | PacMan.gameoverAtlas.textureNamed("gameover1"),
49 | PacMan.gameoverAtlas.textureNamed("gameover2"),
50 | PacMan.gameoverAtlas.textureNamed("gameover3"),
51 | PacMan.gameoverAtlas.textureNamed("gameover4"),
52 | PacMan.gameoverAtlas.textureNamed("gameover5"),
53 | PacMan.gameoverAtlas.textureNamed("gameover6"),
54 | PacMan.gameoverAtlas.textureNamed("gameover7"),
55 | PacMan.gameoverAtlas.textureNamed("gameover8"),
56 | PacMan.gameoverAtlas.textureNamed("gameover9"),
57 | PacMan.gameoverAtlas.textureNamed("gameover10"),
58 | PacMan.gameoverAtlas.textureNamed("gameover11")
59 | ]
60 |
61 |
62 | init() {
63 | let size = CGSize(width: 13, height: 13)
64 | let physicsBody = SKPhysicsBody(rectangleOf: size)
65 |
66 | physicsBody.categoryBitMask = gamePhysics.PacMan
67 |
68 | physicsBody.contactTestBitMask = gamePhysics.Blinky &
69 | gamePhysics.Dot
70 |
71 | physicsBody.isDynamic = true
72 | physicsBody.affectedByGravity = false
73 |
74 | super.init(
75 | position: CGPoint(x: 300, y: 15),
76 | size: size,
77 | texture: PacMan.eatFrames[2],
78 | physicsBody: physicsBody,
79 | direction: .right
80 | )
81 |
82 | self.zPosition = 5
83 | }
84 |
85 | required init?(coder aDecoder: NSCoder) {
86 | // TODO: Does this need a proper implementation?
87 | super.init(coder: aDecoder)
88 | }
89 |
90 | override func update() {
91 | super.update()
92 |
93 | switch self.direction {
94 | case .up:
95 | self.position.y += 1
96 | case.down:
97 | self.position.y -= 1
98 | case .left:
99 | self.position.x -= 1
100 | case .right:
101 | self.position.x += 1
102 | }
103 | }
104 |
105 | func playMunchSound() {
106 | if self.munchAB == .A {
107 | self.run(PacMan.munchA)
108 | self.munchAB = .B
109 | } else {
110 | self.run(PacMan.munchB)
111 | self.munchAB = .A
112 | }
113 | }
114 |
115 | func updateDirection(to newDirection: Direction) {
116 | switch newDirection {
117 | case .up:
118 | if self.xIsClose(to: 214) { self.position.x = 214 }
119 | else { self.position.x = 642 }
120 |
121 | self.xScale = 1
122 | self.zRotation = CGFloat(0.5 * Double.pi)
123 |
124 | case .down:
125 | if self.xIsClose(to: 214) { self.position.x = 214 }
126 | else { self.position.x = 642 }
127 |
128 | self.xScale = 1
129 | self.zRotation = CGFloat(1.5 * Double.pi)
130 |
131 | case .left:
132 | pacman.position.y = 15
133 | self.xScale = -1
134 | pacman.zRotation = 0
135 |
136 | case .right:
137 | pacman.position.y = 15
138 | self.xScale = 1
139 | pacman.zRotation = 0
140 | }
141 |
142 | self.direction = newDirection
143 | }
144 |
145 | func gameover() {
146 | self.xScale = 1
147 | self.zRotation = 0
148 | self.position.y -= 2
149 |
150 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.0) {
151 | self.position.y += 1
152 | }
153 |
154 | self.run(PacMan.gameOverSound)
155 | self.run(
156 | SKAction.animate(
157 | with: PacMan.gameoverFrames,
158 | timePerFrame: 0.1,
159 | resize: false,
160 | restore: true
161 | ),
162 | withKey: "gameover"
163 | )
164 | }
165 | }
166 |
--------------------------------------------------------------------------------
/Pac-Bar/Sprite/Sprite.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Sprite.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 31/08/2020.
6 | // Copyright © 2020 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import SpriteKit
11 |
12 | enum Direction {
13 | case up, down, left, right
14 | }
15 |
16 | class Sprite: SKSpriteNode {
17 | var direction: Direction
18 |
19 | init(
20 | position: CGPoint,
21 | size: CGSize,
22 | texture: SKTexture,
23 | physicsBody: SKPhysicsBody?,
24 | direction: Direction
25 | ) {
26 | self.direction = direction
27 |
28 | super.init(
29 | texture: texture,
30 | color: .clear,
31 | size: size
32 | )
33 |
34 | self.position = position
35 | self.physicsBody = physicsBody
36 | }
37 |
38 | required init?(coder aDecoder: NSCoder) {
39 | // TODO: Does this need a proper implementation?
40 | self.direction = .right
41 | super.init(coder: aDecoder)
42 | }
43 |
44 | func update() {
45 | self.checkOverflow()
46 | }
47 |
48 | func checkOverflow() {
49 | if self.position.x < 0 {
50 | self.position.x = 700
51 | } else if self.position.x > 700 {
52 | self.position.x = 0
53 | }
54 |
55 | if self.position.y < 0 {
56 |
57 | if self.xIsClose(to: 214) {
58 | self.position.x = 642
59 | } else {
60 | self.position.x = 214
61 | }
62 |
63 | self.position.y = 30
64 |
65 | } else if self.position.y > 30 {
66 |
67 | if self.xIsClose(to: 214) {
68 | self.position.x = 642
69 | } else {
70 | self.position.x = 214
71 | }
72 |
73 | self.position.y = 0
74 | }
75 | }
76 |
77 | func currentSquare() -> CGPoint {
78 | return CGPoint(
79 | x: (self.position.x / SQUARE_SIZE).rounded(.towardZero),
80 | y: (self.position.y / SQUARE_SIZE).rounded(.towardZero)
81 | )
82 | }
83 |
84 | func xIsClose(to pos: CGFloat) -> Bool {
85 | return abs(self.position.x - pos) < POS_EPS
86 | }
87 |
88 | func yIsClose(to pos: CGFloat) -> Bool {
89 | return abs(self.position.y - pos) < POS_EPS
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/Pac-Bar/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 21/11/16.
6 | // Copyright © 2016 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class ViewController: NSViewController {
12 |
13 | func createTextField(
14 | origin: CGPoint,
15 | size: CGSize,
16 | fontSize: CGFloat,
17 | stringValue: String
18 | ) -> NSTextField {
19 | let field = NSTextField(frame: NSRect(origin: origin, size: size))
20 | field.font = .systemFont(ofSize: fontSize)
21 | field.alignment = NSTextAlignment.center
22 | field.isBezeled = false
23 | field.drawsBackground = false
24 | field.isEditable = false
25 | field.isSelectable = false
26 | field.stringValue = stringValue
27 | field.textColor = NSColor.yellow
28 | return field
29 | }
30 |
31 | override func viewDidLoad() {
32 | super.viewDidLoad()
33 | self.view.wantsLayer = true
34 | self.view.layer?.backgroundColor = CGColor(
35 | red: 0,
36 | green: 0,
37 | blue: 0,
38 | alpha: 1.0
39 | )
40 |
41 | // Warning/Score text field
42 | textField = self.createTextField(
43 | origin: CGPoint(x: 0, y: 70),
44 | size: CGSize(
45 | width: self.view.frame.width,
46 | height: 80
47 | ),
48 | fontSize: 30,
49 | stringValue: "You need a Touch Bar"
50 | )
51 |
52 | // High score text field
53 | highField = self.createTextField(
54 | origin: CGPoint(x: 0, y: 10),
55 | size: CGSize(
56 | width: self.view.frame.width,
57 | height: 50
58 | ),
59 | fontSize: 25,
60 | stringValue: ""
61 | )
62 |
63 | self.view.addSubview(textField)
64 | self.view.addSubview(highField)
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Pac-Bar/WindowController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // WindowController.swift
3 | // Pac-Bar
4 | //
5 | // Created by Henry Franks on 21/11/16.
6 | // Copyright © 2016 Henry Franks. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 | import SpriteKit
11 |
12 | @available(OSX 10.12.2, *)
13 | fileprivate extension NSTouchBar.CustomizationIdentifier {
14 | static let customizationIdentifier = """
15 | com.henryefranks.touchbar.customizationIdentifier
16 | """
17 | }
18 |
19 | @available(OSX 10.12.2, *)
20 | fileprivate extension NSTouchBarItem.Identifier {
21 | static let identifier = NSTouchBarItem.Identifier(
22 | "com.henryefranks.touchbar.items.identifier")
23 | }
24 |
25 | class WindowController: NSWindowController {
26 |
27 | override func windowDidLoad() {
28 | super.windowDidLoad()
29 | self.window?.title = "Pac-Bar"
30 | self.window?.titleVisibility = .hidden
31 | self.window?.titlebarAppearsTransparent = true
32 | self.window?.styleMask.insert(.fullSizeContentView)
33 | self.window?.styleMask.remove(.resizable)
34 | }
35 |
36 | @available(OSX 10.12.2, *)
37 | override func makeTouchBar() -> NSTouchBar? {
38 | let touchBar = NSTouchBar()
39 | touchBar.delegate = self
40 | touchBar.customizationIdentifier = .customizationIdentifier
41 | touchBar.defaultItemIdentifiers = [.identifier]
42 | touchBar.customizationAllowedItemIdentifiers = [.identifier]
43 | return touchBar
44 | }
45 |
46 | @IBOutlet public weak var mainView: NSWindow!
47 |
48 | override func keyDown(with event: NSEvent) {
49 | switch event.keyCode {
50 | //Control Pac-Man movement
51 | case 123:
52 | //left
53 | if pacman.direction == .right {
54 | pacman.updateDirection(to: .left)
55 | directionCache = nil
56 | } else if pacman.direction != .left {
57 | counter = 15
58 | directionCache = .left
59 | }
60 | case 124:
61 | //right
62 | if pacman.direction == .left {
63 | pacman.updateDirection(to: .right)
64 | directionCache = nil
65 | } else if pacman.direction != .right {
66 | counter = 15
67 | directionCache = .right
68 | }
69 | case 125:
70 | //down
71 | if pacman.direction == .up {
72 | pacman.updateDirection(to: .down)
73 | directionCache = nil
74 | } else if pacman.direction != .down {
75 | counter = 15
76 | directionCache = .down
77 | }
78 | case 126:
79 | //up
80 | if pacman.direction == .down {
81 | pacman.updateDirection(to: .up)
82 | directionCache = nil
83 | } else if pacman.direction != .up {
84 | counter = 15
85 | directionCache = .up
86 | }
87 | default:
88 | break
89 | }
90 | }
91 | }
92 |
93 | @available(OSX 10.12.2, *)
94 | extension WindowController: NSTouchBarDelegate {
95 |
96 | func touchBar(
97 | _ touchBar: NSTouchBar,
98 | makeItemForIdentifier identifier: NSTouchBarItem.Identifier
99 | ) -> NSTouchBarItem? {
100 | switch identifier {
101 | case NSTouchBarItem.Identifier.identifier:
102 | let gameView = SKView()
103 | let scene = GameScene()
104 | let item = NSCustomTouchBarItem(identifier: identifier)
105 | item.view = gameView
106 | gameView.presentScene(scene)
107 | return item
108 | default:
109 | return nil
110 | }
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Pac-Man for the MacBook Pro Touch Bar
4 |
5 |
6 | ### No need to insert coin!
7 | Pac-Bar is the game you never knew you needed. Perfect for when you're bored at
8 | work or just want to relax a little, it puts the classic arcade experience right
9 | at your fingertips by trapping the beloved dot-munching hero in a Touch
10 | Bar-sized maze. To even the odds, he's only being chased by a single ghost this
11 | time, but don't let this fool you: avoiding Binky is just as tricky as it was in
12 | the arcade classic. Use the warp tunnels at the edge of the maze to put some
13 | distance between you and your red foe, and maybe even escape certain death!
14 |
15 | ## Gameplay
16 | **Note: A Touch Bar is required to play**
17 |
18 | The aim of the game is to eat all the dots scattered throughout the maze, but
19 | beware: if Blinky touches you, it's game over! If you succeed in clearing the
20 | maze, you'll proceed to the next level... which is the same as the last. The
21 | maze can reset an infinite number of times, so keep eating those dots until you
22 | get caught. You can move Pac-Man using the arrow keys on your keyboard, so use
23 | them wisely to keep Pac-Man out of danger. The maze has warp tunnels around the
24 | edges that work in mysterious ways... if you try to run out the side of the maze
25 | you'll find yourself at the other end. The tunnels at the top and bottom
26 | transport you not only vertically but also horizontally: if you go up the left
27 | tunnel you'll find yourself at the bottom right of the maze, and vice-versa. Use
28 | this to your advantage if you're in a sticky situation!
29 |
30 |
31 |
32 |
33 |
34 |
35 | Warp tunnels teleport you to the other side of the maze
36 |
37 |
38 |
39 | ## Installation
40 | Getting set up with Pac-Bar is as easy as 1, 2, 3:
41 |
42 | 1. ### Download the game [here][download link]
43 | 2. Unzip the file and move Pac-Bar.app to your Applications folder
44 | 3. The game is now installed! Run it from your Launchpad or your Applications
45 | folder
46 |
47 | ...or at least, it used to be. Unfortunately, due to apple's new insistence on
48 | [notarization], and my own lack of funds, running the game isn't as easy as it
49 | used to be. Now you must right click the app in your applications folder and
50 | select open.
51 |
52 | ## Contributing
53 | Moving forward, I will not be able to continue to personally support Pac-Bar.
54 | The last officially-supported version of macOS will be version 10.15.6
55 | (Catalina), although I will continue to accept contributions.
56 |
57 | Pac-Bar will always be free and open-source, so anyone can contribute! If you
58 | find a bug please [report an issue][issues], and I'll try and fix it as soon as
59 | I can. Or if you implement a feature, feel free to create a
60 | [pull request][pull requests].
61 |
62 | [download link]: //github.com/henryefranks/pac-bar/releases/latest
63 | [notarization]: //developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution
64 | [issues]: //github.com/henryefranks/pac-bar/issues
65 | [pull requests]: //github.com/henryefranks/pac-bar/pulls
66 |
--------------------------------------------------------------------------------
/Resources/General Sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/General Sprites.png
--------------------------------------------------------------------------------
/Resources/Logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
21 |
23 |
26 |
30 |
34 |
35 |
38 |
42 |
46 |
47 |
56 |
65 |
74 |
83 |
92 |
101 |
110 |
111 |
130 |
132 |
133 |
135 | image/svg+xml
136 |
138 |
139 |
140 |
141 |
142 |
147 |
151 |
154 |
157 |
161 |
167 |
168 |
169 |
170 |
171 |
172 |
177 |
186 |
187 |
188 |
--------------------------------------------------------------------------------
/Resources/LogoFull.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/LogoFull.png
--------------------------------------------------------------------------------
/Resources/Pac-Bar Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/Pac-Bar Logo.png
--------------------------------------------------------------------------------
/Resources/Pac-Bar.piko:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/Pac-Bar.piko
--------------------------------------------------------------------------------
/Resources/Pac-Bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/Pac-Bar.png
--------------------------------------------------------------------------------
/Resources/Space.piko:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/Space.piko
--------------------------------------------------------------------------------
/Resources/Text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/Text.png
--------------------------------------------------------------------------------
/Resources/Tunnels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/Tunnels.png
--------------------------------------------------------------------------------
/Resources/pMan.piko:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/pMan.piko
--------------------------------------------------------------------------------
/Resources/pMan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/henryefranks/pac-bar/b1af2f45d022f6992cfbe617643d664267d7cdb8/Resources/pMan.png
--------------------------------------------------------------------------------