diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2009-06-18 16:50:19 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2009-06-18 16:50:19 -0400 |
| commit | 024d098c686ae971176332d91db91582ad353c17 (patch) | |
| tree | 0715eac2b6a34029f35ae5c97116c48ce39c70ce /mazeoflife.cpp | |
| parent | 10ccc825777c7ce8797fc58e1484dd93f19368cf (diff) | |
| download | mazeoflife-024d098c686ae971176332d91db91582ad353c17.tar.gz mazeoflife-024d098c686ae971176332d91db91582ad353c17.tar.bz2 mazeoflife-024d098c686ae971176332d91db91582ad353c17.zip | |
Added movement
Diffstat (limited to 'mazeoflife.cpp')
| -rw-r--r-- | mazeoflife.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
| 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[]) | |||
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | SDL_WM_SetCaption("Maze Of Life", NULL); | 26 | SDL_WM_SetCaption("Maze Of Life", NULL); |
| 27 | SDL_EnableKeyRepeat(100, 50); | ||
| 27 | 28 | ||
| 28 | State* state = new GameState(screen->format); | 29 | State* state = new GameState(screen->format); |
| 29 | 30 | ||
| @@ -37,7 +38,7 @@ int main(int argc, char *argv[]) | |||
| 37 | case SDL_ACTIVEEVENT: | 38 | case SDL_ACTIVEEVENT: |
| 38 | if (anEvent.active.state == SDL_APPINPUTFOCUS) | 39 | if (anEvent.active.state == SDL_APPINPUTFOCUS) |
| 39 | { | 40 | { |
| 40 | // gameSleep = !anEvent.active.gain; | 41 | gameSleep = !anEvent.active.gain; |
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | break; | 44 | break; |
| @@ -45,6 +46,10 @@ int main(int argc, char *argv[]) | |||
| 45 | exit(0); | 46 | exit(0); |
| 46 | 47 | ||
| 47 | break; | 48 | break; |
| 49 | case SDL_KEYDOWN: | ||
| 50 | state->input(anEvent.key.keysym.sym); | ||
| 51 | |||
| 52 | break; | ||
| 48 | } | 53 | } |
| 49 | } | 54 | } |
| 50 | 55 | ||
