change player on tab

This commit is contained in:
Josh Holtrop 2013-02-17 23:19:30 -05:00
parent 8398a09cf1
commit 11d5513c9f
2 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class Game
public: public:
void change_player() void change_player()
{ {
m_pindex = (m_pindex + 1) % 2;
} }
void handle_move_event(ref MoveEvent me) void handle_move_event(ref MoveEvent me)
{ {
@ -34,4 +35,5 @@ public:
protected: protected:
uint m_tick; uint m_tick;
Player[2] m_players; Player[2] m_players;
int m_pindex;
}; };

View File

@ -101,6 +101,9 @@ int main(char[][] args)
break; break;
case SDLK_s: case SDLK_s:
break; break;
case SDLK_TAB:
game.change_player();
break;
default: default:
break; break;
} }