Dit is de code die ik in een spel gebruik om een object (hover) te laten keren. Het ziet er alleen niet efficiënt uit. Kan ik dit alles in één regel stoppen? (en hoe?)
Alvast bedankt!
Alvast bedankt!
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| if (richting == 0) {
setProperty ("_root.hover", _rotation, "0");
}
if (richting == 45) {
setProperty ("_root.hover", _rotation, "45");
}
if (richting == 90) {
setProperty ("_root.hover", _rotation, "90");
}
if (richting == 135) {
setProperty ("_root.hover", _rotation, "135");
}
if (richting == 180) {
setProperty ("_root.hover", _rotation, "180");
}
if (richting == 225) {
setProperty ("_root.hover", _rotation, "225");
}
if (richting == 270) {
setProperty ("_root.hover", _rotation, "270");
}
if (richting == 315) {
setProperty ("_root.hover", _rotation, "315");
} |