Skip to content

Commit

Permalink
[GameKey] 'Up' and 'Down' renamed to 'Forward' and 'Back'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Jul 8, 2020
1 parent 4421f82 commit 4ac67ee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions source/client/core/KeyboardHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
KeyboardHandler::KeyboardHandler() {
addKey(GameKey::Left, "Left", SDLK_a);
addKey(GameKey::Right, "Right", SDLK_d);
addKey(GameKey::Up, "Up", SDLK_w);
addKey(GameKey::Down, "Down", SDLK_s);
addKey(GameKey::Forward, "Forward", SDLK_w);
addKey(GameKey::Back, "Back", SDLK_s);

addKey(GameKey::Jump, "Jump", SDLK_SPACE);
addKey(GameKey::Fly, "Fly", SDLK_x);
Expand Down
12 changes: 6 additions & 6 deletions source/client/world/ClientPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ void ClientPlayer::processInputs() {
m_velocity.z = -0.1;
}

if(gk::GamePad::isKeyPressed(GameKey::Up)) move(0.0f);
else if(gk::GamePad::isKeyPressed(GameKey::Down)) move(180.0f);
if(gk::GamePad::isKeyPressed(GameKey::Forward)) move(0.0f);
else if(gk::GamePad::isKeyPressed(GameKey::Back)) move(180.0f);

if(gk::GamePad::isKeyPressed(GameKey::Left)) move(90.0f);
else if(gk::GamePad::isKeyPressed(GameKey::Right)) move(-90.0f);

if (gk::GamePad::isKeyPressed(GameKey::Left) && gk::GamePad::isKeyPressed(GameKey::Up)) move(45.0f);
if (gk::GamePad::isKeyPressed(GameKey::Right) && gk::GamePad::isKeyPressed(GameKey::Up)) move(-45.0f);
if (gk::GamePad::isKeyPressed(GameKey::Left) && gk::GamePad::isKeyPressed(GameKey::Down)) move(135.0f);
if (gk::GamePad::isKeyPressed(GameKey::Right) && gk::GamePad::isKeyPressed(GameKey::Down)) move(-135.0f);
if (gk::GamePad::isKeyPressed(GameKey::Left) && gk::GamePad::isKeyPressed(GameKey::Forward)) move(45.0f);
if (gk::GamePad::isKeyPressed(GameKey::Right) && gk::GamePad::isKeyPressed(GameKey::Forward)) move(-45.0f);
if (gk::GamePad::isKeyPressed(GameKey::Left) && gk::GamePad::isKeyPressed(GameKey::Back)) move(135.0f);
if (gk::GamePad::isKeyPressed(GameKey::Right) && gk::GamePad::isKeyPressed(GameKey::Back)) move(-135.0f);

if (gk::GamePad::isKeyPressed(GameKey::Sprint)) {
m_velocity.x *= 1.5f;
Expand Down
10 changes: 5 additions & 5 deletions source/common/core/input/GameKey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
*
* =====================================================================================
*/
#ifndef GK_GAMEKEY_HPP_
#define GK_GAMEKEY_HPP_
#ifndef GAMEKEY_HPP_
#define GAMEKEY_HPP_

namespace GameKey {
enum {
Undefined = -1,

Left,
Right,
Up,
Down,
Forward,
Back,

Jump,
Fly,
Expand All @@ -50,4 +50,4 @@ namespace GameKey {
};
}

#endif // GK_GAMEKEY_HPP_
#endif // GAMEKEY_HPP_
2 changes: 1 addition & 1 deletion source/server/network/ServerCommandHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ServerCommandHandler {

Registry &m_registry;

gk::Vector3d m_spawnPosition{14.5, 14.5, 18.};
gk::Vector3d m_spawnPosition{19.5, 14.5, 19.};

ChatCommandHandler m_chatCommandHandler{*this, m_worldController};
};
Expand Down

0 comments on commit 4ac67ee

Please sign in to comment.