mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-06 11:12:19 +00:00
keyboard compoent
This commit is contained in:
@@ -7,8 +7,16 @@
|
|||||||
|
|
||||||
namespace BBM
|
namespace BBM
|
||||||
{
|
{
|
||||||
KeyboardComponent::KeyboardComponent(WAL::Entity &entity)
|
KeyboardComponent::KeyboardComponent(WAL::Entity &entity,
|
||||||
: WAL::Component(entity)
|
Key up,
|
||||||
|
Key down,
|
||||||
|
Key left,
|
||||||
|
Key right,
|
||||||
|
Key jump,
|
||||||
|
Key bomb,
|
||||||
|
Key pause)
|
||||||
|
: WAL::Component(entity), keyJump(jump), keyBomb(bomb), keyPause(pause),
|
||||||
|
keyRight(right), keyLeft(left), keyUp(up), keyDown(down)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
WAL::Component *KeyboardComponent::clone(WAL::Entity &entity) const
|
WAL::Component *KeyboardComponent::clone(WAL::Entity &entity) const
|
||||||
|
|||||||
@@ -33,9 +33,16 @@ namespace BBM
|
|||||||
|
|
||||||
//! @inherit
|
//! @inherit
|
||||||
WAL::Component *clone(WAL::Entity &entity) const override;
|
WAL::Component *clone(WAL::Entity &entity) const override;
|
||||||
|
|
||||||
//! @brief Create a new keyboard component using default keys.
|
//! @brief Create a new keyboard component using custom keys.
|
||||||
explicit KeyboardComponent(WAL::Entity &entity);
|
KeyboardComponent(WAL::Entity &entity,
|
||||||
|
Key up = KEY_W,
|
||||||
|
Key down = KEY_S,
|
||||||
|
Key left = KEY_A,
|
||||||
|
Key right = KEY_D,
|
||||||
|
Key jump = KEY_SPACE,
|
||||||
|
Key bomb = KEY_E,
|
||||||
|
Key pause = RAY::Controller::Keyboard::Key::KEY_ESCAPE);
|
||||||
|
|
||||||
//! @brief A Keyboard component is copy constructable.
|
//! @brief A Keyboard component is copy constructable.
|
||||||
KeyboardComponent(const KeyboardComponent &) = default;
|
KeyboardComponent(const KeyboardComponent &) = default;
|
||||||
|
|||||||
Reference in New Issue
Block a user