From 0e6c6084bfd348d1ac2d7400428322574b56957e Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 22 Dec 2002 18:40:36 +0000 Subject: [PATCH] * tab == hotkey for CEO alert. --- src/Makefile.am | 1 + src/ceo.c | 24 ++++++++++++++++++++++++ src/common.h | 2 ++ src/main.c | 16 +++++++++++----- 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 src/ceo.c diff --git a/src/Makefile.am b/src/Makefile.am index 55891af..e36609c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,6 +20,7 @@ bin_PROGRAMS = ttyvaders ttyvaders_SOURCES = \ aliens.c \ bonus.c \ + ceo.c \ common.h \ explosions.c \ main.c \ diff --git a/src/ceo.c b/src/ceo.c new file mode 100644 index 0000000..da34f75 --- /dev/null +++ b/src/ceo.c @@ -0,0 +1,24 @@ + +#include "common.h" + +void ceo_alert( void ) +{ + char key; + int end = 0; + + while( !end ) + { + clear_graphics(); + + if( get_key() == '\t' ) + { + end = 1; + } + + fprintf( stderr, "foo\n" ); + + refresh_graphics(); + + usleep( 40000 ); + } +} diff --git a/src/common.h b/src/common.h index 0a442ec..6184440 100644 --- a/src/common.h +++ b/src/common.h @@ -162,3 +162,5 @@ void add_explosion( game *g, explosions *ex, int x, int y, int vx, int vy, int t void draw_explosions( game *g, explosions *ex ); void update_explosions( game *g, explosions *ex ); +void ceo_alert( void ); + diff --git a/src/main.c b/src/main.c index 4ce3dc5..63f55b9 100644 --- a/src/main.c +++ b/src/main.c @@ -1,11 +1,14 @@ /* - * ttyvaders - a tty based shoot'em'up - * Copyright (C) 2002 Sam Hocevar + * ttyvaders Textmode shoot'em up + * Copyright (c) 2002 Sam Hocevar + * All Rights Reserved + * + * $Id tarass * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 1, or (at your option) - * any later version. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * */ #include @@ -94,6 +96,10 @@ static void start_game (game *g) case 'p': poz = !poz; break; + case '\t': + ceo_alert(); + poz = 1; + break; case 's': skip = 1; break;