Ignore:
Timestamp:
Dec 23, 2002, 10:28:37 AM (17 years ago)
Author:
Sam Hocevar
Message:
  • the beam now digs the tunnel.
  • the starfield is now an array of stars.
  • fixed wall rendering (offset issues and disappearing left wall).
  • 32 seekers on fragbomb explosion, not 16.
File:
1 edited

Legend:

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

    r38 r50  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: tunnel.c,v 1.4 2002/12/22 18:44:12 sam Exp $
     6 *   $Id: tunnel.c,v 1.5 2002/12/23 09:28:37 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    2525#include "common.h"
    2626
    27 static void draw_wall( game *g, int *wall );
     27static void draw_wall( game *g, int *wall, int delta );
    2828
    2929/* Init tunnel */
     
    4040    if( t->w >= g->w )
    4141    {
    42         t->left[0] = -1;
    43         t->right[0] = g->w;
     42        t->left[0] = -10;
     43        t->right[0] = g->w + 10;
    4444        for( i = 0; i < g->h; i++ )
    4545        {
    46             t->left[i] = -1;
    47             t->right[i] = g->w;
     46            t->left[i] = -10;
     47            t->right[i] = g->w + 10;
    4848        }
    4949    }
     
    7272{
    7373    /* Print tunnel */
    74     draw_wall( g, t->left );
    75     draw_wall( g, t->right );
     74    draw_wall( g, t->left, -2 );
     75    draw_wall( g, t->right, -1 );
    7676}
    7777
    7878void update_tunnel( game *g, tunnel *t )
    7979{
    80     static int const delta[] = { -2, -1, 1, 2 };
     80    static int const delta[] = { -3, -2, -1, 1, 2, 3 };
    8181    int i,j,k;
    8282
     
    8989
    9090    /* Generate new values */
    91     i = delta[GET_RAND(0,4)];
    92     j = delta[GET_RAND(0,4)];
     91    i = delta[GET_RAND(0,6)];
     92    j = delta[GET_RAND(0,6)];
    9393
    9494    /* Check in which direction we need to alter tunnel */
     
    122122    else
    123123    {
    124         t->left[0] = -1;
    125         t->right[0] = g->w;
     124        t->left[0] = -10;
     125        t->right[0] = g->w + 10;
    126126    }
    127127
     
    152152}
    153153
    154 static void draw_wall( game *g, int *wall )
     154static void draw_wall( game *g, int *wall, int delta )
    155155{
    156156    int i;
     
    162162        char *str;
    163163
    164         if( wall[i] < 0 || wall[i] >= g->w )
     164        if( wall[i] < -10 || wall[i] >= g->w + 10 )
    165165        {
    166166            continue;
     
    178178        if( wall[i] == wall[i+1] + 2 )
    179179        {
    180             gfx_goto( wall[i] - 1, i );
     180            gfx_goto( wall[i] - 1 + delta, i );
    181181            gfx_putchar( '_' );
    182182        }
    183183
    184         gfx_goto( wall[i], i );
     184        gfx_goto( wall[i] + delta, i );
    185185        gfx_putstr( str );
    186186        if( wall[i] == wall[i+1] - 2 ) gfx_putchar( '_' );
Note: See TracChangeset for help on using the changeset viewer.