-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelp Scene
189 lines (129 loc) · 6.35 KB
/
Help Scene
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
//
// HelpScene.swift
// Physics Breaker
//
// Created by Charlie Bushman on 1/7/16.
// Copyright © 2016 imaginary inc. All rights reserved.
//
import Foundation
import UIKit
import SpriteKit
class HelpScene: SKScene{
let menuButton = UIButton()
let titleLabel = SKLabelNode()
let helpText1 = SKLabelNode()
let helpText2 = SKLabelNode()
let helpText3 = SKLabelNode()
let helpText4 = SKLabelNode()
let helpText5 = SKLabelNode()
let helpText6 = SKLabelNode()
let helpText7 = SKLabelNode()
let helpText8 = SKLabelNode()
let helpText9 = SKLabelNode()
let furtherHelpButton = UIButton()
override func didMoveToView(view: SKView) {
self.backgroundColor = UIColor.whiteColor() //sets scene's background to white
setUpScene()
setUpZAxis()
}
override func willMoveFromView(view: SKView) {
self.removeAllChildren()
}
func setUpScene(){
/*BUTTON: Button in top right that returns to main menu*/
menuButton.setTitle("MENU", forState: UIControlState.Normal)
menuButton.titleLabel!.font = UIFont(name: "HelveticaNeue-UltraLight", size: 20.0)
menuButton.frame = CGRect(x: self.view!.frame.size.width-100, y: self.view!.frame.size.height-300, width: 100, height: 30)
menuButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
menuButton.addTarget(self, action: #selector(goToMenuHelp), forControlEvents: UIControlEvents.TouchUpInside)
self.view!.addSubview(menuButton)
/*LABEL: Displays title with text 'HELP'*/
titleLabel.fontColor = UIColor.blackColor()
titleLabel.fontSize = 60.0
titleLabel.position = CGPoint(x: CGRectGetMidX(self.frame), y: 550)
titleLabel.text = "HELP"
self.addChild(titleLabel)
/*LABEL: Displays help text as a block; uses multiple labels*/
/*Line 1*/
helpText1.fontColor = UIColor.blackColor()
helpText1.fontSize = 30
helpText1.position = CGPoint(x: CGRectGetMidX(self.frame), y: 480)
helpText1.fontName = "HelveticaNeue"
helpText1.text = "Imaginary Inc took a revolutionary approach to solving physics problems. By "
self.addChild(helpText1)
/*Line 2*/
helpText2.fontColor = UIColor.blackColor()
helpText2.fontSize = 30
helpText2.position = CGPoint(x: CGRectGetMidX(self.frame), y: 440)
helpText2.fontName = "HelveticaNeue"
helpText2.text = "drawing them. Believe it or not, I found it easier to interpret real world "
self.addChild(helpText2)
/*Line 3*/
helpText3.fontColor = UIColor.blackColor()
helpText3.fontSize = 30
helpText3.position = CGPoint(x: CGRectGetMidX(self.frame), y: 400)
helpText3.fontName = "HelveticaNeue"
helpText3.text = "physics problems with drawings of the real world. It's not as if there are "
self.addChild(helpText3)
/*Line 4*/
helpText4.fontColor = UIColor.blackColor()
helpText4.fontSize = 30
helpText4.position = CGPoint(x: CGRectGetMidX(self.frame), y: 360)
helpText4.fontName = "HelveticaNeue"
helpText4.text = "just a bunch of numbers and vectors floating around our heads all the "
self.addChild(helpText4)
/*Line 5*/
helpText5.fontColor = UIColor.blackColor()
helpText5.fontSize = 30
helpText5.position = CGPoint(x: CGRectGetMidX(self.frame), y: 320)
helpText5.fontName = "HelveticaNeue"
helpText5.text = "time; there are pictures and that's how we best interpret physics. So all "
self.addChild(helpText5)
/*Line 6*/
helpText6.fontColor = UIColor.blackColor()
helpText6.fontSize = 30
helpText6.position = CGPoint(x: CGRectGetMidX(self.frame), y: 280)
helpText6.fontName = "HelveticaNeue"
helpText6.text = "you have to do to use this app is draw the problem. Unfortunately there "
self.addChild(helpText6)
/*Line 7*/
helpText7.fontColor = UIColor.blackColor()
helpText7.fontSize = 30
helpText7.position = CGPoint(x: CGRectGetMidX(self.frame), y: 240)
helpText7.fontName = "HelveticaNeue"
helpText7.text = "may be a bit of interpretation you need to do with the limited tools I give "
self.addChild(helpText7)
/*Line 8*/
helpText8.fontColor = UIColor.blackColor()
helpText8.fontSize = 30
helpText8.position = CGPoint(x: CGRectGetMidX(self.frame), y: 200)
helpText8.fontName = "HelveticaNeue"
helpText8.text = "you but I'm sure you can figure it out. If you do get stuck though, just "
self.addChild(helpText8)
/*Line 9*/
helpText9.fontColor = UIColor.blackColor()
helpText9.fontSize = 30
helpText9.position = CGPoint(x: CGRectGetMidX(self.frame), y: 160)
helpText9.fontName = "HelveticaNeue"
helpText9.text = "tap the button below and ask me."
self.addChild(helpText9)
/*BUTTON: Links to a forum designed to provide support for the app*/
furtherHelpButton.setTitle("Further Help", forState: UIControlState.Normal)
furtherHelpButton.titleLabel!.font = UIFont(name: "HelveticaNeue-UltraLight", size: 30.0)
furtherHelpButton.frame = CGRect(x: CGRectGetMidX(self.frame)-325, y: 270, width: 200, height: 50)
furtherHelpButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
furtherHelpButton.addTarget(self, action: #selector(linkToFurtherHelp), forControlEvents: UIControlEvents.TouchUpInside)
self.view!.addSubview(furtherHelpButton)
}
func setUpZAxis(){
}
func goToMenuHelp(sender: UIButton){
let menuScene = MenuScene(size: self.size)
self.view?.presentScene(menuScene, transition: SKTransition.crossFadeWithDuration(0.0))
menuButton.removeFromSuperview()
furtherHelpButton.removeFromSuperview()
}
func linkToFurtherHelp(sender: UIButton){
UIApplication.sharedApplication().openURL(NSURL(string: "http://physics-breaker.freeforums.net")!)
}
}