質問編集履歴
1
コードの省略部分の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,27 +42,139 @@
|
|
42
42
|
|
43
43
|
class ViewController: UIViewController , AVAudioPlayerDelegate {
|
44
44
|
|
45
|
+
|
46
|
+
|
47
|
+
var a = 15.0
|
48
|
+
|
49
|
+
var A = 0.0
|
50
|
+
|
51
|
+
var d = 0.0
|
52
|
+
|
53
|
+
var X = 0.0
|
54
|
+
|
55
|
+
var Y = 0.0
|
56
|
+
|
57
|
+
var Xm = 0.0
|
58
|
+
|
59
|
+
var XM = 0.0
|
60
|
+
|
61
|
+
var Ym = 0.0
|
62
|
+
|
63
|
+
var YM = 0.0
|
64
|
+
|
65
|
+
var total = 0.0
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
let koukaon = Bundle.main.bundleURL.appendingPathComponent("button04b.mp3")
|
70
|
+
|
71
|
+
var buttonsaisei = AVAudioPlayer()
|
72
|
+
|
73
|
+
var i = 0 // View
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
var myImageView1: UIImageView!
|
78
|
+
|
79
|
+
var myImageView2: UIImageView!
|
80
|
+
|
45
81
|
|
46
82
|
|
47
83
|
override func viewDidLoad() {
|
48
84
|
|
49
85
|
super.viewDidLoad()
|
50
86
|
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
51
|
-
|
91
|
+
myImageView1 = UIImageView(frame: CGRect(x:-50,y:-50,width:5.195*6,height:5.195*6))//固視点
|
92
|
+
|
52
|
-
|
93
|
+
myImageView2 = UIImageView(frame: CGRect(x:-50,y:-50,width:5.195*2.2567,height:5.195*2.2567))
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
let myImage1 = UIImage (named:"zyuuzi")
|
100
|
+
|
101
|
+
let myImage2 = UIImage (named:"blue")
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
myImageView1.image = myImage1
|
106
|
+
|
107
|
+
myImageView2.image = myImage2
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
// UIImageViewをViewに追加する
|
112
|
+
|
113
|
+
self.view.addSubview(myImageView1)
|
114
|
+
|
115
|
+
self.view.addSubview(myImageView2)
|
116
|
+
|
117
|
+
|
118
|
+
|
53
|
-
|
119
|
+
//固視点の座標
|
120
|
+
|
54
|
-
|
121
|
+
let position0 = CGPoint(x:300, y:300)
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
55
|
-
|
127
|
+
myImageView1.layer.position = position0
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
d = 12.0 / 11.0
|
132
|
+
|
133
|
+
X = 300 * tan(15.0)
|
134
|
+
|
135
|
+
Y = 300 * tan(3.0)
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
Xm = 300 * tan(15.0 - 5.0 * d)
|
140
|
+
|
141
|
+
XM = 300 * tan(15.0 + 5.0 * d)
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
Ym = 300 * tan(3.0 - 5.0 * d)
|
146
|
+
|
147
|
+
YM = 300 * tan(3.0 + 5.0 * d)
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
56
158
|
|
57
159
|
while total > 0{
|
58
160
|
|
59
|
-
|
60
|
-
|
161
|
+
|
162
|
+
|
61
|
-
|
163
|
+
let positionA1 = CGPoint(x:300+Xm, y:300+Y)
|
164
|
+
|
62
|
-
|
165
|
+
let positionB1 = CGPoint(x:300+X, y:300+YM)
|
166
|
+
|
63
|
-
|
167
|
+
let positionC1 = CGPoint(x:300+Xm, y:300+Y)
|
168
|
+
|
64
|
-
|
169
|
+
let positionD1 = CGPoint(x:300+X, y:300+Ym)
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
var positions1 = [positionA1,positionB1,positionC1,positionD1]
|
174
|
+
|
175
|
+
|
176
|
+
|
65
|
-
@IBAction func No(_ sender: Any) {
|
177
|
+
@IBAction func No(_ sender: Any) {
|
66
178
|
|
67
179
|
}
|
68
180
|
|