mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-27 16:22:09 +00:00
Fix documentation and remove friend keyword
Remove friend keyword and put variables in public instead Fix documentation where the name of the component is not specified Co-Authored-By: Benjamin HENRY <44569175+EternalRat@users.noreply.github.com>
This commit is contained in:
@@ -20,22 +20,22 @@ namespace BBM
|
||||
auto &keyboard = entity.getComponent<KeyboardComponent>();
|
||||
auto &controllable= entity.getComponent<ControllableComponent>();
|
||||
static const std::map<int, bool> keyPressedMap = {
|
||||
{keyboard.keyJump, controllable._jump},
|
||||
{keyboard.keyBomb, controllable._bomb},
|
||||
{keyboard.keyPause, controllable._pause}
|
||||
{keyboard.keyJump, controllable.jump},
|
||||
{keyboard.keyBomb, controllable.bomb},
|
||||
{keyboard.keyPause, controllable.pause}
|
||||
};
|
||||
|
||||
for (auto key : keyPressedMap)
|
||||
key.second = RAY::IsKeyPressed(key.first);
|
||||
controllable._moveX = 0;
|
||||
controllable._moveZ = 0;
|
||||
controllable.moveX = 0;
|
||||
controllable.moveZ = 0;
|
||||
if (RAY::IsKeyPressed(keyboard.keyRight))
|
||||
controllable._moveX += 1;
|
||||
controllable.moveX += 1;
|
||||
if (RAY::IsKeyPressed(keyboard.keyLeft))
|
||||
controllable._moveX -= 1;
|
||||
controllable.moveX -= 1;
|
||||
if (RAY::IsKeyPressed(keyboard.keyUp))
|
||||
controllable._moveX += 1;
|
||||
controllable.moveX += 1;
|
||||
if (RAY::IsKeyPressed(keyboard.keyDown))
|
||||
controllable._moveX -= 1;
|
||||
controllable.moveX -= 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user