-
Notifications
You must be signed in to change notification settings - Fork 0
/
God.java
33 lines (32 loc) · 1.18 KB
/
God.java
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
public class God {
public static void move() {
if (MyKeyListener.LEFT)
Camara.angle.y += 0.1;
if (MyKeyListener.RIGHT)
Camara.angle.y -= 0.1;
if (MyKeyListener.UP)
Camara.angle.x += 0.1;
if (MyKeyListener.DOWN)
Camara.angle.x -= 0.1;
if (MyKeyListener.W) {
Camara.position.x += Math.cos(Camara.angle.y) * 500;
Camara.position.z += Math.sin(Camara.angle.y) * 500;
}
if (MyKeyListener.S) {
Camara.position.x -= Math.cos(Camara.angle.y) * 500;
Camara.position.z -= Math.sin(Camara.angle.y) * 500;
}
if (MyKeyListener.A) {
Camara.position.x += Math.cos(Camara.angle.y + Math.PI * 0.5) * 500;
Camara.position.z += Math.sin(Camara.angle.y + Math.PI * 0.5) * 500;
}
if (MyKeyListener.D) {
Camara.position.x -= Math.cos(Camara.angle.y + Math.PI * 0.5) * 500;
Camara.position.z -= Math.sin(Camara.angle.y + Math.PI * 0.5) * 500;
}
if (MyKeyListener.E)
Camara.position.y += 500;
if (MyKeyListener.Q)
Camara.position.y -= 500;
}
}