blob: 08811b55e2f991ee0a39267f38b82a6d108524c2 (
plain)
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
|
package ru.olamedia.player;
import ru.olamedia.liveEntity.LiveEntity;
import ru.olamedia.olacraft.game.Game;
import ru.olamedia.olacraft.network.packet.LiveEntityLocationUpdatePacket;
import ru.olamedia.olacraft.weapon.Bullet;
public class Player extends LiveEntity {
@Override
public void notifyLocationUpdate() {
LiveEntityLocationUpdatePacket p = new LiveEntityLocationUpdatePacket();
p.x = getX();
p.y = getY();
p.z = getZ();
Game.client.send(p);
}
public Player() {
}
public void onMouseClick() {
Bullet b = new Bullet();
b.velocity.set(Game.instance.camera.getLook());
b.velocity.negate();
b.velocity.scale(100);
b.location.set(getX(), getCameraY(), getZ());
Game.client.getScene().addBullet(b);
}
}
|