Преглед изворни кода

* tab == hotkey for CEO alert.

tags/v0.99.beta14
Sam Hocevar sam пре 22 година
родитељ
комит
0e6c6084bf
4 измењених фајлова са 38 додато и 5 уклоњено
  1. +1
    -0
      src/Makefile.am
  2. +24
    -0
      src/ceo.c
  3. +2
    -0
      src/common.h
  4. +11
    -5
      src/main.c

+ 1
- 0
src/Makefile.am Прегледај датотеку

@@ -20,6 +20,7 @@ bin_PROGRAMS = ttyvaders
ttyvaders_SOURCES = \
aliens.c \
bonus.c \
ceo.c \
common.h \
explosions.c \
main.c \


+ 24
- 0
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 );
}
}

+ 2
- 0
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 );


+ 11
- 5
src/main.c Прегледај датотеку

@@ -1,11 +1,14 @@
/*
* ttyvaders - a tty based shoot'em'up
* Copyright (C) 2002 Sam Hocevar <sam@zoy.org>
* ttyvaders Textmode shoot'em up
* Copyright (c) 2002 Sam Hocevar <sam@zoy.org>
* 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 <stdio.h>
@@ -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;


Loading…
Откажи
Сачувај