diff --git a/Guibe.xcodeproj/project.pbxproj b/Guibe.xcodeproj/project.pbxproj index eb570f3..1382a6c 100644 --- a/Guibe.xcodeproj/project.pbxproj +++ b/Guibe.xcodeproj/project.pbxproj @@ -13,6 +13,8 @@ 506421C722A339B7001E8877 /* xright.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 506421C422A339B7001E8877 /* xright.mp3 */; }; 506421C922A33D87001E8877 /* InstructionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506421C822A33D87001E8877 /* InstructionsViewController.swift */; }; 506421CD22A33EA5001E8877 /* TechSpecsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506421CC22A33EA5001E8877 /* TechSpecsViewController.swift */; }; + 50969F5A22AFD57E0000C5ED /* GameLearnViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50969F5922AFD57E0000C5ED /* GameLearnViewController.swift */; }; + 50969F5E22AFEBE80000C5ED /* SecondGameLearnViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50969F5D22AFEBE80000C5ED /* SecondGameLearnViewController.swift */; }; 50A7ADD5229D6A4200D58743 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */; }; 50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD6229D6A4200D58743 /* ViewController.swift */; }; 50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50A7ADD8229D6A4200D58743 /* Main.storyboard */; }; @@ -40,6 +42,8 @@ 506421C422A339B7001E8877 /* xright.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = xright.mp3; sourceTree = ""; }; 506421C822A33D87001E8877 /* InstructionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstructionsViewController.swift; sourceTree = ""; }; 506421CC22A33EA5001E8877 /* TechSpecsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TechSpecsViewController.swift; sourceTree = ""; }; + 50969F5922AFD57E0000C5ED /* GameLearnViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameLearnViewController.swift; sourceTree = ""; }; + 50969F5D22AFEBE80000C5ED /* SecondGameLearnViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondGameLearnViewController.swift; sourceTree = ""; }; 50A7ADD1229D6A4200D58743 /* Guibe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Guibe.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 50A7ADD6229D6A4200D58743 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -105,6 +109,8 @@ 50A7ADD6229D6A4200D58743 /* ViewController.swift */, 50A7ADE6229D6C7100D58743 /* Assets.xcassets */, 50A7ADD8229D6A4200D58743 /* Main.storyboard */, + 50969F5922AFD57E0000C5ED /* GameLearnViewController.swift */, + 50969F5D22AFEBE80000C5ED /* SecondGameLearnViewController.swift */, 50E3DDF222AC5F9200E04D0B /* setupTextInstructionsViewController.swift */, 50B1485D22A46F7A008B16AF /* VideoInstrictionsViewController.swift */, 50B1485B22A46EBD008B16AF /* WrittenInstructionsViewController.swift */, @@ -225,7 +231,9 @@ 50A7ADFD229D766800D58743 /* 7_ReadyViewController.swift in Sources */, 506421CD22A33EA5001E8877 /* TechSpecsViewController.swift in Sources */, 50A7ADF9229D75C100D58743 /* 5_HandChoiceViewController.swift in Sources */, + 50969F5A22AFD57E0000C5ED /* GameLearnViewController.swift in Sources */, 50B1485E22A46F7A008B16AF /* VideoInstrictionsViewController.swift in Sources */, + 50969F5E22AFEBE80000C5ED /* SecondGameLearnViewController.swift in Sources */, 50E3DDF322AC5F9200E04D0B /* setupTextInstructionsViewController.swift in Sources */, 50B1485C22A46EBD008B16AF /* WrittenInstructionsViewController.swift in Sources */, 50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */, diff --git a/Guibe/6_SideChoiceViewController.swift b/Guibe/6_SideChoiceViewController.swift index 301a4a6..e4549f8 100644 --- a/Guibe/6_SideChoiceViewController.swift +++ b/Guibe/6_SideChoiceViewController.swift @@ -17,13 +17,13 @@ class S6deChoiceViewController: UIViewController { @IBAction func topBigPressed(_ sender: Any) { defaults.set(1, forKey: "bigSide") - let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen7") as! R7adyViewController + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen6_5") as! GameLearnViewController nextViewController.modalTransitionStyle = .crossDissolve self.present(nextViewController, animated: true, completion: nil) } @IBAction func bottomBigPressed(_ sender: Any) { defaults.set(2, forKey: "bigSide") - let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen7") as! R7adyViewController + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen6_5") as! GameLearnViewController nextViewController.modalTransitionStyle = .crossDissolve self.present(nextViewController, animated: true, completion: nil) } diff --git a/Guibe/Assets.xcassets/buttonMedSize.imageset/Contents.json b/Guibe/Assets.xcassets/buttonMedSize.imageset/Contents.json new file mode 100644 index 0000000..e6d1abd --- /dev/null +++ b/Guibe/Assets.xcassets/buttonMedSize.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "buttonMedSize.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "buttonMedSize-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "buttonMedSize-2.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize-1.png b/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize-1.png new file mode 100644 index 0000000..35d690c Binary files /dev/null and b/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize-1.png differ diff --git a/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize-2.png b/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize-2.png new file mode 100644 index 0000000..35d690c Binary files /dev/null and b/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize-2.png differ diff --git a/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize.png b/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize.png new file mode 100644 index 0000000..35d690c Binary files /dev/null and b/Guibe/Assets.xcassets/buttonMedSize.imageset/buttonMedSize.png differ diff --git a/Guibe/Base.lproj/Main.storyboard b/Guibe/Base.lproj/Main.storyboard index fd95708..d7b29de 100644 --- a/Guibe/Base.lproj/Main.storyboard +++ b/Guibe/Base.lproj/Main.storyboard @@ -183,9 +183,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -204,9 +267,8 @@ - - + @@ -744,7 +806,7 @@ + @@ -901,10 +976,10 @@ - + - To turn on your guibe, press the button on the **side of the bracelet**. Your Guibe bracelet will vibrate to let you know that the connection has been successful. + To turn on your guibe, press the button on the **side of the bracelet**. Your Guibe bracelet will vibrate to let you know that the connection has been successful. Go to the main screen to search for a destination. When ready, select ‘Begin Journey’. You will feel 3 buzzes: ready, steady, go! You are now ready to start the journey and can begin walking. @@ -916,7 +991,7 @@ You are almost set, just one more instruction! When you have arrived at your des The casing of your device serves as a portable charger. Charge the casing via the mains and simply slip the guibe onto the casing dock to charge it wirelessly. -And that’s all you need to know to follow the vibe! +And that’s all you need to know to follow the vibe! @@ -1062,11 +1137,75 @@ And that’s all you need to know to follow the vibe! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Guibe/GameLearnViewController.swift b/Guibe/GameLearnViewController.swift new file mode 100644 index 0000000..2a6af8e --- /dev/null +++ b/Guibe/GameLearnViewController.swift @@ -0,0 +1,133 @@ + +// +// GameLearnViewController.swift +// Guibe +// +// Created by Max Hunt on 11/06/2019. +// Copyright © 2019 8. All rights reserved. +// + +import UIKit +import AVKit + +class GameLearnViewController: UIViewController { + + @IBOutlet weak var mainButton: UIButton! + @IBOutlet weak var textLabel: UILabel! + @IBOutlet weak var progressBar: UIProgressView! + @IBOutlet weak var nextBtn: UIButton! + + @IBAction func buttonPressed(_ sender: Any) { + + } + @IBAction func nextBtnPressed(_ sender: Any) { + stepCounter += 1 + stepThrough(ptr: stepCounter) + } + + var stepCounter: Int = 0 + + + + override func viewDidLoad() { + super.viewDidLoad() + + textLabel.text = "Now we will .......\n........." + + + // Do any additional setup after loading the view. + } + + func stepThrough(ptr:Int) { + switch ptr { + case 1: + beginJourney() + case 2: + arrivedAtDestination() + case 3: + wrongDirection() + case 4: + turnRight() + case 5: + turnLeft() + case 6: + showDone() + case 7: + nextPage() + default: + return + } + } + + func beginJourney() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'begin journey'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.2, animated: true) + self.textLabel.accessibilityLabel = "This means begin journey" + self.mainButton.accessibilityLabel = "Try me" + } + + func arrivedAtDestination() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'arrived at destination'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.4, animated: true) + self.textLabel.accessibilityLabel = "This means arrived at destination" + self.mainButton.accessibilityLabel = "Try me" + } + + func wrongDirection() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'you're walking in the wrong direction'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.6, animated: true) + self.textLabel.accessibilityLabel = "This means you're walking in the wrong direction" + self.mainButton.accessibilityLabel = "Try me" + } + + func turnRight() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'turn right'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.8, animated: true) + self.textLabel.accessibilityLabel = "This means turn right" + self.mainButton.accessibilityLabel = "Try me" + } + + func turnLeft() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'begin journey'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(1.0, animated: true) + self.textLabel.accessibilityLabel = "This means turn left" + self.mainButton.accessibilityLabel = "Try me" + } + + func showDone() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "You are finished" + self.mainButton.alpha = 0.0 + self.progressBar.alpha = 0.0 + self.textLabel.accessibilityLabel = "You are finished" + self.mainButton.accessibilityLabel = "Try me" + } + + func nextPage() { + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen7") as! R7adyViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } + +} + +extension UIView { + + func fadeTransition(_ duration:CFTimeInterval) { + let animation = CATransition() + animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) + animation.type = CATransitionType.fade + animation.duration = duration + layer.add(animation, forKey: CATransitionType.fade.rawValue) + } +} diff --git a/Guibe/SecondGameLearnViewController.swift b/Guibe/SecondGameLearnViewController.swift new file mode 100644 index 0000000..8cabf47 --- /dev/null +++ b/Guibe/SecondGameLearnViewController.swift @@ -0,0 +1,126 @@ +// +// SecondGameLearnViewController.swift +// Guibe +// +// Created by Max Hunt on 11/06/2019. +// Copyright © 2019 8. All rights reserved. +// + +import UIKit + +class SecondGameLearnViewController: UIViewController { + @IBOutlet weak var textLabel: UILabel! + @IBOutlet weak var mainButton: UIButton! + @IBOutlet weak var nextBtn: UIButton! + @IBOutlet weak var progressBar: UIProgressView! + + @IBAction func mainBtnPressed(_ sender: Any) { + + } + + @IBAction func nextBtnPressed(_ sender: Any) { + stepCounter += 1 + stepThrough(ptr: stepCounter) + } + + var stepCounter: Int = 0 + + override func viewDidLoad() { + super.viewDidLoad() + + textLabel.text = "Now we will .......\n........." + // Do any additional setup after loading the view. + } + + + func stepThrough(ptr:Int) { + switch ptr { + case 1: + beginJourney() + case 2: + arrivedAtDestination() + case 3: + wrongDirection() + case 4: + turnRight() + case 5: + turnLeft() + case 6: + showDone() + case 7: + nextPage() + default: + return + } + } + + func beginJourney() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'begin journey'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.2, animated: true) + self.textLabel.accessibilityLabel = "This means begin journey" + self.mainButton.accessibilityLabel = "Try me" + } + + func arrivedAtDestination() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'arrived at destination'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.4, animated: true) + self.textLabel.accessibilityLabel = "This means arrived at destination" + self.mainButton.accessibilityLabel = "Try me" + } + + func wrongDirection() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'you're walking in the wrong direction'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.6, animated: true) + self.textLabel.accessibilityLabel = "This means you're walking in the wrong direction" + self.mainButton.accessibilityLabel = "Try me" + } + + func turnRight() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'turn right'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(0.8, animated: true) + self.textLabel.accessibilityLabel = "This means turn right" + self.mainButton.accessibilityLabel = "Try me" + } + + func turnLeft() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "This means \n'begin journey'" + self.mainButton.setTitle("Try me", for: .normal) + self.progressBar.setProgress(1.0, animated: true) + self.textLabel.accessibilityLabel = "This means turn left" + self.mainButton.accessibilityLabel = "Try me" + } + + func showDone() { + self.textLabel.fadeTransition(0.5) + self.textLabel.text = "You are finished" + self.mainButton.alpha = 0.0 + self.progressBar.alpha = 0.0 + self.textLabel.accessibilityLabel = "You are finished" + self.mainButton.accessibilityLabel = "Try me" + } + + func nextPage() { + self.dismiss(animated: true, completion: nil) + } + +} + +//extension UIView { +// +// func fadeTransition(_ duration:CFTimeInterval) { +// let animation = CATransition() +// animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) +// animation.type = CATransitionType.fade +// animation.duration = duration +// layer.add(animation, forKey: CATransitionType.fade.rawValue) +// } +//}