diff --git a/Pacman3D-iOS/Base.lproj/LaunchScreen.storyboard b/Pacman3D-iOS/Base.lproj/LaunchScreen.storyboard index fdf3f97d1b6e9d8d29bb69a88c4d89ca752bd937..bd3d092540d8efa652d7290bd1fe481fe40c2b52 100644 --- a/Pacman3D-iOS/Base.lproj/LaunchScreen.storyboard +++ b/Pacman3D-iOS/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,11 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> + <device id="retina4_7" orientation="landscape"> + <adaptation id="fullscreen"/> + </device> <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> @@ -14,14 +18,27 @@ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <rect key="frame" x="0.0" y="0.0" width="667" height="375"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <subviews> + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen" translatesAutoresizingMaskIntoConstraints="NO" id="vjF-TF-aIH"> + <rect key="frame" x="183" y="37" width="300" height="300"/> + </imageView> + </subviews> + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <constraints> + <constraint firstItem="vjF-TF-aIH" firstAttribute="top" secondItem="Llm-lL-Icb" secondAttribute="bottom" constant="17" id="IiC-5F-LVv"/> + <constraint firstItem="vjF-TF-aIH" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="g4n-x6-kS0"/> + <constraint firstItem="vjF-TF-aIH" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="mqA-KI-O7V"/> + </constraints> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="53" y="375"/> + <point key="canvasLocation" x="52.623688155922046" y="373.60000000000002"/> </scene> </scenes> + <resources> + <image name="LaunchScreen" width="300" height="320"/> + </resources> </document> diff --git a/Pacman3D-iOS/Monster.swift b/Pacman3D-iOS/Monster.swift index 039c011925b802dcd7422c408a9877caf56fd9ee..680329edaa1d6721f4166869015089335e3c14d0 100644 --- a/Pacman3D-iOS/Monster.swift +++ b/Pacman3D-iOS/Monster.swift @@ -12,7 +12,20 @@ import SceneKit class Monster: Equatable { private (set) var position: SCNVector3 - private var direction: Direction = .north + private var direction: Direction = .north { + didSet { + switch direction { + case .north: + node?.rotation = SCNVector4(x: 0, y: 1, z: 0, w: 1.5 * Float.pi - Float.pi * 0.25) + case .east: + node?.rotation = SCNVector4(x: 0, y: 1, z: 0, w: 1.0 * Float.pi - Float.pi * 0.25) + case .south: + node?.rotation = SCNVector4(x: 0, y: 1, z: 0, w: 0.5 * Float.pi - Float.pi * 0.25) + case .west: + node?.rotation = SCNVector4(x: 0, y: 1, z: 0, w: 2.0 * Float.pi - Float.pi * 0.25) + } + } + } private let level: Level private let scene: SCNScene