mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Handle decor shifting with multiple key press
Then it's possible to shift with the keyboard like the mouse (NE, NW, SE, SW).
This commit is contained in:
parent
874164e615
commit
5b789cfb2d
@ -5014,17 +5014,21 @@ bool CEvent::TreatEventBase (const SDL_Event &event)
|
||||
}
|
||||
return true;
|
||||
case SDLK_LEFT:
|
||||
DecorShift (-2, 2);
|
||||
return true;
|
||||
case SDLK_RIGHT:
|
||||
DecorShift (2, -2);
|
||||
return true;
|
||||
case SDLK_UP:
|
||||
DecorShift (-3, -3);
|
||||
return true;
|
||||
case SDLK_DOWN:
|
||||
DecorShift (3, 3);
|
||||
{
|
||||
const Uint8 *state = SDL_GetKeyboardState (nullptr);
|
||||
if (state[SDL_SCANCODE_LEFT])
|
||||
DecorShift (-2, 2);
|
||||
if (state[SDL_SCANCODE_RIGHT])
|
||||
DecorShift (2, -2);
|
||||
if (state[SDL_SCANCODE_UP])
|
||||
DecorShift (-3, -3);
|
||||
if (state[SDL_SCANCODE_DOWN])
|
||||
DecorShift (3, 3);
|
||||
return true;
|
||||
}
|
||||
case SDLK_HOME:
|
||||
pos = m_pDecor->GetHome();
|
||||
m_pDecor->SetCoin (pos);
|
||||
|
Loading…
x
Reference in New Issue
Block a user