Skip to content

Commit

Permalink
added game over screen
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehasawii committed Apr 27, 2023
1 parent 6e5fa80 commit 225dcb0
Show file tree
Hide file tree
Showing 16 changed files with 325 additions and 70 deletions.
12 changes: 8 additions & 4 deletions SoundboardQuiz.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
2A0ACF1929F1A02F001E5D03 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A0ACF0A29F1A02E001E5D03 /* AppDelegate.swift */; };
2A0ACF1B29F1A02F001E5D03 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 2A0ACF0C29F1A02E001E5D03 /* Model.xcdatamodeld */; };
2A0ACF1C29F1A02F001E5D03 /* LevelSelectController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A0ACF0E29F1A02E001E5D03 /* LevelSelectController.swift */; };
2A0ACF1D29F1A02F001E5D03 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A0ACF0F29F1A02E001E5D03 /* Media.xcassets */; };
2A0ACF1E29F1A02F001E5D03 /* CategoryTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A0ACF1029F1A02E001E5D03 /* CategoryTableViewCell.swift */; };
2A0ACF2029F1A02F001E5D03 /* Sounds in Resources */ = {isa = PBXBuildFile; fileRef = 2A0ACF1229F1A02E001E5D03 /* Sounds */; };
2A0ACF2129F1A02F001E5D03 /* SoundboardQuiz.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 2A0ACF1329F1A02F001E5D03 /* SoundboardQuiz.xcdatamodeld */; };
Expand All @@ -30,6 +29,8 @@
2AC1DDC129F6D292001253C3 /* SoundCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC1DDC029F6D292001253C3 /* SoundCollectionViewCell.swift */; };
2AC1DDC329F6D2A8001253C3 /* ImageCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC1DDC229F6D2A8001253C3 /* ImageCollectionViewCell.swift */; };
2AC1DDC929F6E1A2001253C3 /* TestTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC1DDC829F6E1A2001253C3 /* TestTableViewCell.swift */; };
2AC744AC29FB1CF5006E0CD7 /* GameOverViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC744AB29FB1CF5006E0CD7 /* GameOverViewController.swift */; };
2AC744AE29FB2F55006E0CD7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2AC744AD29FB2F55006E0CD7 /* Images.xcassets */; };
2AFCB22C29FACDEA003BD84E /* CellObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCB22B29FACDEA003BD84E /* CellObject.swift */; };
2AFCB22E29FAD2B5003BD84E /* ShuffleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCB22D29FAD2B5003BD84E /* ShuffleView.swift */; };
/* End PBXBuildFile section */
Expand All @@ -41,7 +42,6 @@
2A0ACF0B29F1A02E001E5D03 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SoundboardQuiz/Info.plist; sourceTree = "<group>"; };
2A0ACF0D29F1A02E001E5D03 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
2A0ACF0E29F1A02E001E5D03 /* LevelSelectController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LevelSelectController.swift; path = SoundboardQuiz/LevelSelectController.swift; sourceTree = "<group>"; };
2A0ACF0F29F1A02E001E5D03 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Media.xcassets; path = SoundboardQuiz/Media.xcassets; sourceTree = "<group>"; };
2A0ACF1029F1A02E001E5D03 /* CategoryTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CategoryTableViewCell.swift; path = SoundboardQuiz/CategoryTableViewCell.swift; sourceTree = "<group>"; };
2A0ACF1229F1A02E001E5D03 /* Sounds */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Sounds; path = SoundboardQuiz/Sounds; sourceTree = "<group>"; };
2A0ACF1429F1A02F001E5D03 /* SoundboardQuiz.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SoundboardQuiz.xcdatamodel; sourceTree = "<group>"; };
Expand All @@ -60,6 +60,8 @@
2AC1DDC029F6D292001253C3 /* SoundCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SoundCollectionViewCell.swift; path = SoundboardQuiz/SoundCollectionViewCell.swift; sourceTree = "<group>"; };
2AC1DDC229F6D2A8001253C3 /* ImageCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ImageCollectionViewCell.swift; path = SoundboardQuiz/ImageCollectionViewCell.swift; sourceTree = "<group>"; };
2AC1DDC829F6E1A2001253C3 /* TestTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestTableViewCell.swift; sourceTree = "<group>"; };
2AC744AB29FB1CF5006E0CD7 /* GameOverViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = GameOverViewController.swift; path = SoundboardQuiz/GameOverViewController.swift; sourceTree = "<group>"; };
2AC744AD29FB2F55006E0CD7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SoundboardQuiz/Images.xcassets; sourceTree = "<group>"; };
2AFCB22B29FACDEA003BD84E /* CellObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CellObject.swift; path = SoundboardQuiz/CellObject.swift; sourceTree = "<group>"; };
2AFCB22D29FAD2B5003BD84E /* ShuffleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ShuffleView.swift; path = SoundboardQuiz/ShuffleView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -82,13 +84,14 @@
2A0ACF0A29F1A02E001E5D03 /* AppDelegate.swift */,
2A0ACF2A29F1A63C001E5D03 /* Data */,
2A0ACF1529F1A02F001E5D03 /* Assets.xcassets */,
2AC744AD29FB2F55006E0CD7 /* Images.xcassets */,
2A0ACF1029F1A02E001E5D03 /* CategoryTableViewCell.swift */,
2A0ACF0B29F1A02E001E5D03 /* Info.plist */,
2A0ACF0E29F1A02E001E5D03 /* LevelSelectController.swift */,
2A0ACF0929F1A02E001E5D03 /* LevelSelectTableViewController.swift */,
2A0ACF0F29F1A02E001E5D03 /* Media.xcassets */,
2A0ACF2529F1A0F3001E5D03 /* LaunchScreen.storyboard */,
2A0ACF2729F1A107001E5D03 /* Main.storyboard */,
2AC744AB29FB1CF5006E0CD7 /* GameOverViewController.swift */,
2AFCB22D29FAD2B5003BD84E /* ShuffleView.swift */,
2A9093D629F73564002DBA4F /* MainGameViewController.swift */,
2A9093D029F71DD3002DBA4F /* BoxContainerView.swift */,
Expand Down Expand Up @@ -183,10 +186,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2A0ACF1D29F1A02F001E5D03 /* Media.xcassets in Resources */,
2A0ACF2029F1A02F001E5D03 /* Sounds in Resources */,
2A0ACF2829F1A107001E5D03 /* Main.storyboard in Resources */,
2A0ACF2629F1A0F3001E5D03 /* LaunchScreen.storyboard in Resources */,
2AC744AE29FB2F55006E0CD7 /* Images.xcassets in Resources */,
2A0ACF2229F1A02F001E5D03 /* Assets.xcassets in Resources */,
2A0ACF2C29F1A66E001E5D03 /* PreloadedData.plist in Resources */,
);
Expand All @@ -203,6 +206,7 @@
2A0ACF1E29F1A02F001E5D03 /* CategoryTableViewCell.swift in Sources */,
2A0ACF2329F1A02F001E5D03 /* SceneDelegate.swift in Sources */,
2A2B750F29F2F0130089DE69 /* SquareCollectionViewController.swift in Sources */,
2AC744AC29FB1CF5006E0CD7 /* GameOverViewController.swift in Sources */,
2AFCB22E29FAD2B5003BD84E /* ShuffleView.swift in Sources */,
2A9093D129F71DD3002DBA4F /* BoxContainerView.swift in Sources */,
2A9093D529F72D49002DBA4F /* SoundCollectionView.swift in Sources */,
Expand Down
58 changes: 52 additions & 6 deletions SoundboardQuiz/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,20 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" image="shuffle" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="NMK-3v-9w8">
<rect key="frame" x="16" y="8" width="44" height="41"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="shuffle" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="NMK-3v-9w8">
<rect key="frame" x="16" y="10" width="44" height="38"/>
<color key="tintColor" systemColor="systemBackgroundColor"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemCyanColor"/>
<gestureRecognizers/>
<constraints>
<constraint firstItem="dg5-ny-NNJ" firstAttribute="leading" secondItem="CeK-06-gX6" secondAttribute="leading" constant="98" id="OvE-Oz-p4x"/>
<constraint firstAttribute="bottom" secondItem="NMK-3v-9w8" secondAttribute="bottom" constant="8" id="Pkf-Fp-Hdz"/>
<constraint firstItem="dg5-ny-NNJ" firstAttribute="centerY" secondItem="CeK-06-gX6" secondAttribute="centerY" id="WIc-37-bdk"/>
<constraint firstAttribute="trailing" secondItem="NMK-3v-9w8" secondAttribute="trailing" constant="178" id="rv6-xJ-flq"/>
<constraint firstItem="dg5-ny-NNJ" firstAttribute="leading" secondItem="NMK-3v-9w8" secondAttribute="trailing" constant="38" id="eEy-hs-eiO"/>
<constraint firstItem="NMK-3v-9w8" firstAttribute="top" secondItem="CeK-06-gX6" secondAttribute="top" constant="8" id="kfh-me-4x2"/>
<constraint firstItem="NMK-3v-9w8" firstAttribute="leading" secondItem="CeK-06-gX6" secondAttribute="leading" constant="16" id="vMY-ar-HYc"/>
<constraint firstAttribute="trailing" secondItem="dg5-ny-NNJ" secondAttribute="trailing" constant="85" id="xZw-pl-Q9N"/>
</constraints>
<connections>
Expand Down Expand Up @@ -333,7 +336,9 @@
<connections>
<outlet property="containerView1" destination="89A-kF-OLT" id="6n4-W9-n6e"/>
<outlet property="containerView2" destination="tVM-2t-eum" id="ZJw-jI-V1L"/>
<outlet property="scoreLabel" destination="yp5-VI-CkV" id="ArL-mB-KJt"/>
<outlet property="shuffleView" destination="CeK-06-gX6" id="5Lg-bP-05Q"/>
<segue destination="5mH-T7-Cgi" kind="show" identifier="segueGameOver" id="PbQ-UP-vcv"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="SXb-yR-Lvk" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand All @@ -345,10 +350,10 @@
</objects>
<point key="canvasLocation" x="4915.2671755725187" y="57.74647887323944"/>
</scene>
<!--View Controller-->
<!--Game Over View Controller-->
<scene sceneID="0NE-ly-DJo">
<objects>
<viewController storyboardIdentifier="GameOver" id="5mH-T7-Cgi" sceneMemberID="viewController">
<viewController storyboardIdentifier="GameOver" id="5mH-T7-Cgi" customClass="GameOverViewController" customModule="SoundboardQuiz" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="KWn-3S-AeE">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -360,10 +365,39 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GGs-E4-Kal">
<rect key="frame" x="143" y="537" width="108" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="gray" title="New Game"/>
<connections>
<action selector="newGamePressed:" destination="5mH-T7-Cgi" eventType="touchUpInside" id="koT-fq-Maz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="n1u-Cu-Byc">
<rect key="frame" x="117" y="615" width="160" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="gray" title="Exit to Main Menu"/>
<connections>
<action selector="mainMenuPressed:" destination="5mH-T7-Cgi" eventType="touchUpInside" id="TRZ-Gy-Hr6"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Score: 999999" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aZC-yI-DHl">
<rect key="frame" x="139" y="455" width="116" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="aSw-39-Hao"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="SRY-pT-R39"/>
<connections>
<outlet property="scoreLabel" destination="aZC-yI-DHl" id="KA3-Tj-OL0"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="VWD-7r-l90" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
Expand Down Expand Up @@ -398,11 +432,23 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="c30-gz-Y6Z">
<rect key="frame" x="0.0" y="0.0" width="111" height="115"/>
</imageView>
</subviews>
<constraints>
<constraint firstItem="c30-gz-Y6Z" firstAttribute="leading" secondItem="jx4-11-57y" secondAttribute="leading" id="7BQ-S2-edX"/>
<constraint firstAttribute="bottom" secondItem="c30-gz-Y6Z" secondAttribute="bottom" id="8vx-qC-qIj"/>
<constraint firstItem="c30-gz-Y6Z" firstAttribute="height" secondItem="jx4-11-57y" secondAttribute="height" id="IJA-M0-ERM"/>
<constraint firstItem="c30-gz-Y6Z" firstAttribute="top" secondItem="jx4-11-57y" secondAttribute="top" id="Zw9-mE-gRI"/>
<constraint firstAttribute="trailing" secondItem="c30-gz-Y6Z" secondAttribute="trailing" id="fIw-0q-rxl"/>
<constraint firstItem="c30-gz-Y6Z" firstAttribute="width" secondItem="jx4-11-57y" secondAttribute="width" id="viT-gX-gLa"/>
</constraints>
</collectionViewCellContentView>
<color key="backgroundColor" systemColor="systemRedColor"/>
<size key="customSize" width="111.00000000000001" height="115"/>
<connections>
<outlet property="image" destination="c30-gz-Y6Z" id="1mA-bL-nPb"/>
<outlet property="label" destination="njJ-Ga-52s" id="0Jw-Lg-eeL"/>
</connections>
</collectionViewCell>
Expand All @@ -415,7 +461,7 @@
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="473-qW-fyf" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="5501.5267175572517" y="-429.57746478873241"/>
<point key="canvasLocation" x="5500.7633587786258" y="-429.57746478873241"/>
</scene>
<!--Square Collection View Controller-->
<scene sceneID="Ohd-zN-G3d">
Expand Down
Loading

0 comments on commit 225dcb0

Please sign in to comment.