diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-02-03 13:17:25 +0100 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-02-03 13:17:25 +0100 |
commit | 23ead8155bb2721f007ccd2c93eba488e1da3007 (patch) | |
tree | 67c242b1850355e8a3d9b7ab2db0593df79a7ad0 /src/GameState.cpp | |
parent | Implemented Position type serialization (diff) | |
download | AltCraft-23ead8155bb2721f007ccd2c93eba488e1da3007.tar AltCraft-23ead8155bb2721f007ccd2c93eba488e1da3007.tar.gz AltCraft-23ead8155bb2721f007ccd2c93eba488e1da3007.tar.bz2 AltCraft-23ead8155bb2721f007ccd2c93eba488e1da3007.tar.lz AltCraft-23ead8155bb2721f007ccd2c93eba488e1da3007.tar.xz AltCraft-23ead8155bb2721f007ccd2c93eba488e1da3007.tar.zst AltCraft-23ead8155bb2721f007ccd2c93eba488e1da3007.zip |
Diffstat (limited to '')
-rw-r--r-- | src/GameState.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/GameState.cpp b/src/GameState.cpp index de9f1d7..20926e0 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -27,6 +27,7 @@ void GameState::Update(float deltaTime) { PUSH_EVENT("SendPacket",packet); } + selectedBlock = Vector(Vector(player->pos.x,player->pos.y,player->pos.z) - Vector(-1,0,0)); } } @@ -470,4 +471,17 @@ glm::mat4 GameState::GetViewMatrix() { glm::vec3 eyePos = player->pos.glm(); eyePos += player->EyeOffset.glm(); return glm::lookAt(eyePos, eyePos + front, up); -}
\ No newline at end of file +} + +void GameState::StartDigging() { + auto packetStart = std::make_shared<PacketPlayerDigging>(0,selectedBlock,1); + auto packetStop = std::make_shared<PacketPlayerDigging>(2,selectedBlock,1); + auto packet = std::static_pointer_cast<Packet>(packetStart); + PUSH_EVENT("SendPacket",packet); + packet = std::static_pointer_cast<Packet>(packetStop); + PUSH_EVENT("SendPacket",packet); +} + +void GameState::StopDigging() { + +} |