Ignore:
Timestamp:
Nov 9, 2003, 2:16:19 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • Coding style everywhere.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/src/player.c

    r80 r88  
    2626
    2727/* Init tunnel */
    28 player * create_player( game *g )
     28player * create_player(game *g)
    2929{
    3030    player *p = malloc(sizeof(player));
     
    4242}
    4343
    44 void free_player( player *p )
     44void free_player(player *p)
    4545{
    46     free( p );
     46    free(p);
    4747}
    4848
    49 void draw_player( game *g, player *p )
     49void draw_player(game *g, player *p)
    5050{
    51     if( p->dead )
     51    if(p->dead)
    5252    {
    5353        return;
    5454    }
    5555
    56     ee_goto( p->x + 2, p->y - 2 );
    57     ee_color( EE_GREEN );
    58     ee_putstr( "/\\" );
    59     ee_goto( p->x + 1, p->y - 1 );
    60     ee_putchar( '(' );
    61     ee_color( EE_YELLOW );
    62     ee_putstr( "()" );
    63     ee_color( EE_GREEN );
    64     ee_putchar( ')' );
    65     ee_goto( p->x, p->y );
    66     ee_color( EE_GREEN );
    67     ee_putstr( "I<__>I" );
     56    ee_goto(p->x + 2, p->y - 2);
     57    ee_color(EE_GREEN);
     58    ee_putstr("/\\");
     59    ee_goto(p->x + 1, p->y - 1);
     60    ee_putchar('(');
     61    ee_color(EE_YELLOW);
     62    ee_putstr("()");
     63    ee_color(EE_GREEN);
     64    ee_putchar(')');
     65    ee_goto(p->x, p->y);
     66    ee_color(EE_GREEN);
     67    ee_putstr("I<__>I");
    6868}
    6969
    70 void update_player( game *g, player *p )
     70void update_player(game *g, player *p)
    7171{
    72     if( p->dead )
     72    if(p->dead)
    7373    {
    7474        return;
    7575    }
    7676
    77     if( p->life <= 0 )
     77    if(p->life <= 0)
    7878    {
    79         add_explosion( g, g->ex, p->x, p->y, 0, 0, EXPLOSION_SMALL );
     79        add_explosion(g, g->ex, p->x, p->y, 0, 0, EXPLOSION_SMALL);
    8080        p->dead = 1;
    8181        return;
     
    8383
    8484    /* Update weapon stats */
    85     if( p->weapon )
     85    if(p->weapon)
    8686    {
    8787        p->weapon--;
    8888    }
    8989
    90     if( p->special < MAX_SPECIAL )
     90    if(p->special < MAX_SPECIAL)
    9191    {
    9292        p->special++;
     
    9494
    9595    /* Update life */
    96     if( p->life < MAX_LIFE )
     96    if(p->life < MAX_LIFE)
    9797    {
    9898        p->life++;
     
    102102    p->x += p->vx;
    103103
    104     if( p->vx < 0 )
     104    if(p->vx < 0)
    105105    {
    106106        p->vx++;
    107107    }
    108     else if( p->vx > 0 )
     108    else if(p->vx > 0)
    109109    {
    110110        p->vx--;
    111111    }
    112112
    113     if( p->x < 1 )
     113    if(p->x < 1)
    114114    {
    115115        p->x = 1;
    116116    }
    117     else if( p->x > g->w - 7 )
     117    else if(p->x > g->w - 7)
    118118    {
    119119        p->x = g->w - 7;
Note: See TracChangeset for help on using the changeset viewer.