From 024d098c686ae971176332d91db91582ad353c17 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 18 Jun 2009 16:50:19 -0400 Subject: Added movement --- mazeoflife.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mazeoflife.cpp') diff --git a/mazeoflife.cpp b/mazeoflife.cpp index 0e3464a..20bee1d 100644 --- a/mazeoflife.cpp +++ b/mazeoflife.cpp @@ -24,6 +24,7 @@ int main(int argc, char *argv[]) } SDL_WM_SetCaption("Maze Of Life", NULL); + SDL_EnableKeyRepeat(100, 50); State* state = new GameState(screen->format); @@ -37,13 +38,17 @@ int main(int argc, char *argv[]) case SDL_ACTIVEEVENT: if (anEvent.active.state == SDL_APPINPUTFOCUS) { - // gameSleep = !anEvent.active.gain; + gameSleep = !anEvent.active.gain; } break; case SDL_QUIT: exit(0); + break; + case SDL_KEYDOWN: + state->input(anEvent.key.keysym.sym); + break; } } -- cgit 1.4.1