aboutsummaryrefslogtreecommitdiffstats
path: root/play.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2003-03-26 07:04:01 +0000
committerH. Peter Anvin <hpa@zytor.com>2003-03-26 07:04:01 +0000
commit503aa676efd5f0e5216b84eec647e348ceb0b5c1 (patch)
tree45eae66dc836807f3936dfa0e01fcd6c7912344e /play.c
parent9bd970a1d7bc60d47e576b40857fa93a4690a83a (diff)
downloadgrv-503aa676efd5f0e5216b84eec647e348ceb0b5c1.tar.gz
grv-503aa676efd5f0e5216b84eec647e348ceb0b5c1.tar.xz
grv-503aa676efd5f0e5216b84eec647e348ceb0b5c1.zip
Getting close... the only thing missing now as far as I know is the
per-level highscore stuff (and if we want to add to the character set)
Diffstat (limited to 'play.c')
-rw-r--r--play.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/play.c b/play.c
index 0d0fceb..fe2d4cd 100644
--- a/play.c
+++ b/play.c
@@ -101,15 +101,37 @@ static void handle_key(SDL_KeyboardEvent *ke)
if ( mod & (KMOD_RALT|KMOD_LALT) ) {
/* These keystrokes require <Alt> */
- if ( sym == SDLK_F5 ) {
+ switch ( sym ) {
+ case SDLK_F5:
+ gp.Life = 0;
+ case SDLK_F4:
+ gp.EOLWait = 0;
+ case SDLK_d:
gp.Status = Status_Dead;
- } else if ( sym == SDLK_END ) {
- /* Zap game */
- exit(1);
- } else if ( sym == SDLK_l ) {
- gp.Cheat = 1;
+ break;
+ case SDLK_k:
gp.EOLWait = 0;
+ case SDLK_l:
+ gp.Cheat = 1;
gp.Status = Status_Done; /* End of level */
+ break;
+ case SDLK_p:
+ if ( gp.Life < 6 ) {
+ gp.Cheat = 1;
+ gp.Life++;
+ color(14,gp.c);
+ lprintf(1,16+2*gp.Life, "\x01");
+ }
+ break;
+ case SDLK_t:
+ gp.Cheat = 1;
+ mystery();
+ break;
+ case SDLK_END:
+ /* Zap game */
+ exit(1);
+ default:
+ break;
}
}