Procházet zdrojové kódy

* the bomb's head is now white

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/ttyvaders/trunk@26 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam před 22 roky
rodič
revize
2cc05eae95
5 změnil soubory, kde provedl 67 přidání a 30 odebrání
  1. +3
    -3
      Makefile
  2. +2
    -2
      configure.ac
  3. +7
    -2
      doc/shapes.txt
  4. +1
    -1
      src/collide.c
  5. +54
    -22
      src/weapons.c

+ 3
- 3
Makefile Zobrazit soubor

@@ -76,16 +76,16 @@ OBJEXT = o
PACKAGE = ttyvaders
PACKAGE_BUGREPORT =
PACKAGE_NAME = ttyvaders
PACKAGE_STRING = ttyvaders 0.0cvs
PACKAGE_STRING = ttyvaders 0.0cvs-20021215
PACKAGE_TARNAME = ttyvaders
PACKAGE_VERSION = 0.0cvs
PACKAGE_VERSION = 0.0cvs-20021215
PATH_SEPARATOR = :
SET_MAKE =
SHELL = /bin/sh
STRIP =
USE_NCURSES_FALSE =
USE_NCURSES_TRUE = #
VERSION = 0.0cvs
VERSION = 0.0cvs-20021215
ac_ct_CC = gcc
ac_ct_STRIP =
am__fastdepCC_FALSE =


+ 2
- 2
configure.ac Zobrazit soubor

@@ -1,12 +1,12 @@
dnl Autoconf settings for ttyvaders

AC_INIT(ttyvaders,0.0cvs)
AC_INIT(ttyvaders,0.0cvs-20021218)

AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(src/main.c)
AC_CANONICAL_SYSTEM

AM_INIT_AUTOMAKE(ttyvaders,0.0cvs)
AM_INIT_AUTOMAKE(ttyvaders,0.0cvs-20021218)
AM_CONFIG_HEADER(config.h)

AM_PROG_CC_C_O


+ 7
- 2
doc/shapes.txt Zobrazit soubor

@@ -18,8 +18,8 @@ Aliens
`V' `V' `V' ' `V' ` / `V' \

,---. ,---. ,---. ,---. ,---.
(_°_°_) (__°_°) (°__°_) (_°__°) (°_°__)
^ ^ ^ ^ ^ ^ ^ ^ ^ ^
(_^_^_) (__^_^) (^__^_) (_^__^) (^_^__)
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
,---. ,---. ,---. ,---. ,---.
(((o))) ((((o)) (((o))) ((o)))) (((o)))
`---' `---' `---' `---' `---'
@@ -30,6 +30,11 @@ Aliens
,(|). / \
/,-'-.\ ,(_X_).

_>|<_
\ o /
\ /
V

Bonus
-----
_ _ _


+ 1
- 1
src/collide.c Zobrazit soubor

@@ -211,7 +211,7 @@ void collide_weapons_aliens( game *g, weapons *wp, aliens *al, explosions *ex )
if( x >= al->x[j] && x <= al->x[j] + 4
&& y >= al->y[j] && y <= al->y[j] + 2 )
{
al->life[j]--;
al->life[j] -= wp->type[i] == WEAPON_BOMB ? 5 : 1;
if( al->life[j] <= 0 )
{
al->type[j] = ALIEN_NONE;


+ 54
- 22
src/weapons.c Zobrazit soubor

@@ -196,7 +196,7 @@ void add_weapon( game *g, weapons *wp, int x, int y, int vx, int vy, int type )
wp->y2[i] = y;
wp->x3[i] = x;
wp->y3[i] = y;
wp->n[i] = 10;
wp->n[i] = 20;
break;
case WEAPON_BEAM:
wp->n[i] = 25;
@@ -228,18 +228,24 @@ static void draw_bomb( int x, int y, int vx, int vy )
gfx_putstr( "/`-." );
gfx_goto( x-4, y );
gfx_putstr( "`-._\\" );
gfx_color( WHITE );
gfx_goto( x-1, y );
gfx_putstr( "_\\" );
gfx_goto( x, y+1 );
gfx_putchar( '`' );
}
else if( vy < -vx/4 )
{
/* 1pi/6 */
gfx_goto( x-1, y-1 );
gfx_putstr( "_," );
gfx_goto( x-4, y );
gfx_putstr( ",-' /" );
gfx_putstr( ",-' " );
gfx_goto( x-4, y+1 );
gfx_putstr( "\\,-'" );
gfx_color( WHITE );
gfx_goto( x-1, y-1 );
gfx_putstr( "_," );
gfx_goto( x, y );
gfx_putchar( '/' );
}
else
{
@@ -247,7 +253,10 @@ static void draw_bomb( int x, int y, int vx, int vy )
gfx_goto( x-4, y-1 );
gfx_putstr( "____" );
gfx_goto( x-5, y );
gfx_putstr( "|____>" );
gfx_putstr( "|____" );
gfx_color( WHITE );
gfx_goto( x, y );
gfx_putchar( '>' );
}
}
else /* top quarter */
@@ -255,36 +264,43 @@ static void draw_bomb( int x, int y, int vx, int vy )
if( vx > -vy/4 )
{
/* 2pi/6 */
gfx_goto( x-1, y-1 );
gfx_putstr( "_," );
gfx_goto( x-2, y );
gfx_putstr( "/ |" );
gfx_putstr( "/ " );
gfx_goto( x-3, y+1 );
gfx_putstr( "/ /" );
gfx_goto( x-3, y+2 );
gfx_putstr( "`'" );
gfx_color( WHITE );
gfx_goto( x-1, y-1 );
gfx_putstr( "_," );
gfx_goto( x, y );
gfx_putchar( '|' );
}
else if( vx < vy/4 )
{
/* 4pi/6 */
gfx_goto( x, y-1 );
gfx_putstr( "._" );
gfx_goto( x, y );
gfx_putstr( "| \\" );
gfx_goto( x+1, y );
gfx_putstr( " \\" );
gfx_goto( x+1, y+1 );
gfx_putstr( "\\ \\" );
gfx_goto( x+2, y+2 );
gfx_putstr( "`'" );
gfx_color( WHITE );
gfx_goto( x, y-1 );
gfx_putstr( "._" );
gfx_goto( x, y );
gfx_putchar( '|' );
}
else
{
/* 3pi/6 */
gfx_goto( x-1, y );
gfx_putstr( ",^." );
gfx_goto( x-1, y+1 );
gfx_putstr( "| |" );
gfx_goto( x-1, y+2 );
gfx_putstr( "|_|" );
gfx_color( WHITE );
gfx_goto( x-1, y );
gfx_putstr( ",^." );
}
}
}
@@ -300,7 +316,10 @@ static void draw_bomb( int x, int y, int vx, int vy )
gfx_goto( x-2, y-1 );
gfx_putstr( "\\ \\" );
gfx_goto( x-1, y );
gfx_putstr( "\\_|" );
gfx_putchar( '\\' );
gfx_color( WHITE );
gfx_goto( x, y );
gfx_putstr( "_|" );
}
else if( vx < -vy/4 )
{
@@ -309,6 +328,9 @@ static void draw_bomb( int x, int y, int vx, int vy )
gfx_putstr( ",." );
gfx_goto( x, y-1 );
gfx_putstr( "/ /" );
gfx_goto( x+1, y );
gfx_putchar( '/' );
gfx_color( WHITE );
gfx_goto( x-1, y );
gfx_putstr( "|_/" );
}
@@ -321,6 +343,7 @@ static void draw_bomb( int x, int y, int vx, int vy )
gfx_putstr( "| |" );
gfx_goto( x-1, y-1 );
gfx_putstr( "| |" );
gfx_color( WHITE );
gfx_goto( x-1, y );
gfx_putstr( "`v'" );
}
@@ -332,28 +355,37 @@ static void draw_bomb( int x, int y, int vx, int vy )
/* -5pi/6 */
gfx_goto( x+1, y-1 );
gfx_putstr( ",-'\\" );
gfx_goto( x, y );
gfx_putstr( "/_,-'" );
gfx_goto( x+2, y );
gfx_putstr( ",-'" );
gfx_goto( x, y+1 );
gfx_putchar( '\'' );
gfx_color( WHITE );
gfx_goto( x, y );
gfx_putstr( "/_" );
}
else if( vy < vx/4 )
{
/* 5pi/6 */
gfx_goto( x+1, y );
gfx_putstr( " `-." );
gfx_goto( x+1, y+1 );
gfx_putstr( "`-./" );
gfx_color( WHITE );
gfx_goto( x, y-1 );
gfx_putstr( "._" );
gfx_goto( x, y );
gfx_putstr( "\\ `-." );
gfx_goto( x+1, y+1 );
gfx_putstr( "`-./" );
gfx_putchar( '\\' );
}
else
{
/* 6pi/6 */
gfx_goto( x+1, y-1 );
gfx_putstr( "____" );
gfx_goto( x+1, y );
gfx_putstr( "____|" );
gfx_color( WHITE );
gfx_goto( x, y );
gfx_putstr( "<____|" );
gfx_putchar( '<' );
}
}
}
@@ -482,7 +514,7 @@ static void draw_beam( int x, int y, int frame )
{
gfx_color( WHITE );
gfx_goto( x-1, y-3-i );
gfx_putstr( "####" );
gfx_putstr( (i+frame) % 5 ? "####" : "%%%%" );
gfx_color( CYAN );
gfx_goto( x-2, y-3-i );
gfx_putchar( '%' );


Načítá se…
Zrušit
Uložit