| 1875 | } |
| 1876 | |
| 1877 | void PlayLayer::onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event) |
| 1878 | { |
| 1879 | GameToolbox::log("Key with keycode {} released", static_cast<int>(keyCode)); |
| 1880 | if ((keyCode == EventKeyboard::KeyCode::KEY_A && _player1->direction == -1.f) || |
| 1881 | (keyCode == EventKeyboard::KeyCode::KEY_D && _player1->direction == 1.f) && _player1->m_bIsPlatformer) |
| 1882 | _player1->direction = 0.f; |
| 1883 | switch (keyCode) |
| 1884 | { |
| 1885 | case EventKeyboard::KeyCode::KEY_SPACE: { |
| 1886 | if (_player1->m_bIsHolding) |
| 1887 | _player1->releaseButton(); |
| 1888 | if (_isDualMode && _player2->m_bIsHolding) |
| 1889 | _player2->releaseButton(); |
| 1890 | } |
| 1891 | break; |
| 1892 | case EventKeyboard::KeyCode::KEY_UP_ARROW: { |
| 1893 | if (_player1->m_bIsHolding) |
| 1894 | _player1->releaseButton(); |
| 1895 | if (_isDualMode && _player2->m_bIsHolding) |
| 1896 | _player2->releaseButton(); |
| 1897 | } |
| 1898 | default: |
| 1899 | break; |
| 1900 | } |
| 1901 | } |
| 1902 | |
| 1903 | void PlayLayer::tweenBottomGround(float y) |
| 1904 | { |
nothing calls this directly
no test coverage detected