From 23ead8155bb2721f007ccd2c93eba488e1da3007 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 3 Feb 2018 17:17:25 +0500 Subject: Implemented basic digging --- src/GameState.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/GameState.cpp') 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(0,selectedBlock,1); + auto packetStop = std::make_shared(2,selectedBlock,1); + auto packet = std::static_pointer_cast(packetStart); + PUSH_EVENT("SendPacket",packet); + packet = std::static_pointer_cast(packetStop); + PUSH_EVENT("SendPacket",packet); +} + +void GameState::StopDigging() { + +} -- cgit v1.2.3