回答編集履歴
1
直感的な操作でなかった
test
CHANGED
@@ -36,13 +36,43 @@
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
|
39
|
+
float s = sin(radians(angle * direction));
|
40
40
|
|
41
|
-
|
41
|
+
float c = cos(radians(angle * direction));
|
42
42
|
|
43
|
-
if (hat.left()) imgX -= margin;
|
44
43
|
|
44
|
+
|
45
|
+
if (hat.up()) {
|
46
|
+
|
47
|
+
imgX -= s * margin;
|
48
|
+
|
49
|
+
imgY -= c * margin;
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
if (hat.down()) {
|
54
|
+
|
55
|
+
imgX += s * margin;
|
56
|
+
|
57
|
+
imgY += c * margin;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
if (hat.left()) {
|
62
|
+
|
63
|
+
imgX -= c * margin;
|
64
|
+
|
65
|
+
imgY += s * margin;
|
66
|
+
|
67
|
+
}
|
68
|
+
|
45
|
-
if (hat.right())
|
69
|
+
if (hat.right()) {
|
70
|
+
|
71
|
+
imgX += c * margin;
|
72
|
+
|
73
|
+
imgY -= s * margin;
|
74
|
+
|
75
|
+
}
|
46
76
|
|
47
77
|
}
|
48
78
|
|