Skip to content

Commit

Permalink
- Add new game option
Browse files Browse the repository at this point in the history
- Simplify animation code
- Correct bugs
  • Loading branch information
clarknt committed Aug 4, 2019
1 parent 3e7911e commit 54fea41
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
95E2165822E80258001B4703 /* CardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E2165722E80258001B4703 /* CardCell.swift */; };
95E2165A22E80953001B4703 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95E2165922E80953001B4703 /* Card.swift */; };
95ECED3922E79C26001E70BE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95ECED3822E79C26001E70BE /* AppDelegate.swift */; };
95ECED3B22E79C26001E70BE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95ECED3A22E79C26001E70BE /* ViewController.swift */; };
95ECED3B22E79C26001E70BE /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95ECED3A22E79C26001E70BE /* GameViewController.swift */; };
95ECED3E22E79C26001E70BE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 95ECED3C22E79C26001E70BE /* Main.storyboard */; };
95ECED4022E79C28001E70BE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 95ECED3F22E79C28001E70BE /* Assets.xcassets */; };
95ECED4322E79C28001E70BE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 95ECED4122E79C28001E70BE /* LaunchScreen.storyboard */; };
95EF2C5922F5E52800D4CC0C /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95EF2C5822F5E52800D4CC0C /* SettingsViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -23,11 +24,12 @@
95E2165922E80953001B4703 /* Card.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Card.swift; sourceTree = "<group>"; };
95ECED3522E79C26001E70BE /* Milestone-Projects28-30.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Milestone-Projects28-30.app"; sourceTree = BUILT_PRODUCTS_DIR; };
95ECED3822E79C26001E70BE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
95ECED3A22E79C26001E70BE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
95ECED3A22E79C26001E70BE /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = "<group>"; };
95ECED3D22E79C26001E70BE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
95ECED3F22E79C28001E70BE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
95ECED4222E79C28001E70BE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
95ECED4422E79C28001E70BE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
95EF2C5822F5E52800D4CC0C /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -61,9 +63,10 @@
isa = PBXGroup;
children = (
95ECED3822E79C26001E70BE /* AppDelegate.swift */,
95ECED3A22E79C26001E70BE /* ViewController.swift */,
95E2165922E80953001B4703 /* Card.swift */,
95E2165722E80258001B4703 /* CardCell.swift */,
95ECED3A22E79C26001E70BE /* GameViewController.swift */,
95EF2C5822F5E52800D4CC0C /* SettingsViewController.swift */,
95ECED3C22E79C26001E70BE /* Main.storyboard */,
95ECED3F22E79C28001E70BE /* Assets.xcassets */,
95ECED4122E79C28001E70BE /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -145,9 +148,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
95ECED3B22E79C26001E70BE /* ViewController.swift in Sources */,
95ECED3B22E79C26001E70BE /* GameViewController.swift in Sources */,
95ECED3922E79C26001E70BE /* AppDelegate.swift in Sources */,
95E2165822E80258001B4703 /* CardCell.swift in Sources */,
95EF2C5922F5E52800D4CC0C /* SettingsViewController.swift in Sources */,
95E2165A22E80953001B4703 /* Card.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="PCF-5A-sjf">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="9XA-sa-5Ki">
<device id="retina6_1" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--GameViewController-->
<scene sceneID="e7Y-kZ-fuB">
<objects>
<collectionViewController id="PCF-5A-sjf" customClass="ViewController" customModule="Milestone_Projects28_30" customModuleProvider="target" sceneMemberID="viewController">
<collectionViewController id="PCF-5A-sjf" userLabel="GameViewController" customClass="GameViewController" customModule="Milestone_Projects28_30" customModuleProvider="target" sceneMemberID="viewController">
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" contentInsetAdjustmentBehavior="always" delaysContentTouches="NO" canCancelContentTouches="NO" bouncesZoom="NO" dataMode="prototypes" id="ytM-zj-yHN">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -38,9 +39,44 @@
<outlet property="delegate" destination="PCF-5A-sjf" id="Mtv-z4-1rs"/>
</connections>
</collectionView>
<navigationItem key="navigationItem" id="EmU-Ep-P79"/>
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="NtU-6M-6dd" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="957.97101449275374" y="20.758928571428569"/>
</scene>
<!--SettingsViewController-->
<scene sceneID="GP4-uc-hgZ">
<objects>
<viewController storyboardIdentifier="SettingsViewController" id="p4T-s4-MXh" userLabel="SettingsViewController" customClass="SettingsViewController" customModule="Milestone_Projects28_30" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="isf-gU-Wz0">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="4CO-Dp-bxu"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Mou-PR-Go9" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1799" y="21"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="BcZ-fh-nqD">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="9XA-sa-5Ki" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="UX9-p9-Mz3">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="PCF-5A-sjf" kind="relationship" relationship="rootViewController" id="TXL-CI-OoN"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Emf-BN-Ezc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="74" y="21"/>
</scene>
</scenes>
</document>
4 changes: 2 additions & 2 deletions 61-Milestone-Projects28-30/Milestone-Projects28-30/Card.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

import Foundation

enum CardSide {
enum CardState {
case front
case back
case matched
case complete
}

class Card {
var visibleSide: CardSide = .back
var state: CardState = .back

var backImage: String
var frontImage: String
Expand Down
Loading

0 comments on commit 54fea41

Please sign in to comment.