Changeset 23 for libcaca/trunk/src/main.c
- Timestamp:
- Dec 15, 2002, 6:16:45 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/main.c
r21 r23 128 128 { 129 129 g->p->weapon = 4; 130 add_weapon( g, g->wp, g->p->x << 4, g->p->y << 4, -24, -16, WEAPON_SEEKER ); 131 add_weapon( g, g->wp, (g->p->x + 5) << 4, g->p->y << 4, 24, -16, WEAPON_SEEKER ); 130 add_weapon( g, g->wp, (g->p->x + 2) << 4, g->p->y << 4, 0, -16, WEAPON_BOMB ); 132 131 } 133 132 case ' ': … … 137 136 add_weapon( g, g->wp, g->p->x << 4, g->p->y << 4, 0, -16, WEAPON_LASER ); 138 137 add_weapon( g, g->wp, (g->p->x + 5) << 4, g->p->y << 4, 0, -16, WEAPON_LASER ); 138 /* Extra shtuph */ 139 add_weapon( g, g->wp, g->p->x << 4, g->p->y << 4, -24, -16, WEAPON_SEEKER ); 140 add_weapon( g, g->wp, (g->p->x + 5) << 4, g->p->y << 4, 24, -16, WEAPON_SEEKER ); 141 /* More shtuph */ 142 add_weapon( g, g->wp, (g->p->x + 1) << 4, (g->p->y - 1) << 4, 0, -16, WEAPON_LASER ); 143 add_weapon( g, g->wp, (g->p->x + 4) << 4, (g->p->y - 1) << 4, 0, -16, WEAPON_LASER ); 144 /* Even more shtuph */ 145 add_weapon( g, g->wp, (g->p->x + 2) << 4, (g->p->y - 1) << 4, 0, -16, WEAPON_LASER ); 146 add_weapon( g, g->wp, (g->p->x + 3) << 4, (g->p->y - 1) << 4, 0, -16, WEAPON_LASER ); 147 /* Extra shtuph */ 148 add_weapon( g, g->wp, g->p->x << 4, g->p->y << 4, -32, 0, WEAPON_SEEKER ); 149 add_weapon( g, g->wp, (g->p->x + 5) << 4, g->p->y << 4, 32, 0, WEAPON_SEEKER ); 139 150 } 140 151 break; … … 144 155 usleep(40000); 145 156 146 if( GET_RAND(0,10) == 0)157 if( !poz || skip ) 147 158 { 148 int list[3] = { ALIEN_POOLP, ALIEN_BOOL, ALIEN_BRAH }; 149 150 add_alien( g, g->al, 0, rand() % g->h / 2, list[GET_RAND(0,3)] ); 159 skip = 0; 160 161 /* XXX: to be removed */ 162 if( GET_RAND(0,10) == 0 ) 163 { 164 int list[3] = { ALIEN_POOLP, ALIEN_BOOL, ALIEN_BRAH }; 165 166 add_alien( g, g->al, 0, rand() % g->h / 2, list[GET_RAND(0,3)] ); 167 } 168 169 /* Update game rules */ 170 if( g->t->right[1] - g->t->left[1] == g->t->w ) 171 { 172 g->t->w = 85 - g->t->w; 173 } 174 175 /* Scroll and update positions */ 176 collide_player_tunnel( g, g->p, g->t, g->ex ); 177 update_player( g, g->p ); 178 collide_player_tunnel( g, g->p, g->t, g->ex ); 179 180 update_starfield( g, g->sf ); 181 update_bonus( g, g->bo ); 182 update_aliens( g, g->al ); 183 184 collide_weapons_tunnel( g, g->wp, g->t, g->ex ); 185 collide_weapons_aliens( g, g->wp, g->al, g->ex ); 186 update_weapons( g, g->wp ); 187 collide_weapons_tunnel( g, g->wp, g->t, g->ex ); 188 collide_weapons_aliens( g, g->wp, g->al, g->ex ); 189 190 update_explosions( g, g->ex ); 191 /*if(purcompteur%2)*/ update_tunnel( g, g->t ); 151 192 } 152 153 if( poz )154 {155 if( skip )156 {157 skip = 0;158 }159 else160 {161 continue;162 }163 }164 165 /* Update game rules */166 if( g->t->right[1] - g->t->left[1] == g->t->w )167 {168 g->t->w = 85 - g->t->w;169 }170 171 /* Scroll and update positions */172 collide_player_tunnel( g, g->p, g->t, g->ex );173 update_player( g, g->p );174 collide_player_tunnel( g, g->p, g->t, g->ex );175 176 update_starfield( g, g->sf );177 update_bonus( g, g->bo );178 update_aliens( g, g->al );179 180 collide_weapons_tunnel( g, g->wp, g->t, g->ex );181 collide_weapons_aliens( g, g->wp, g->al, g->ex );182 update_weapons( g, g->wp );183 collide_weapons_tunnel( g, g->wp, g->t, g->ex );184 collide_weapons_aliens( g, g->wp, g->al, g->ex );185 186 update_explosions( g, g->ex );187 /*if(purcompteur%2)*/ update_tunnel( g, g->t );188 193 189 194 /* Clear screen */ … … 196 201 draw_aliens( g, g->al ); 197 202 draw_player( g, g->p ); 203 draw_explosions( g, g->ex ); 198 204 draw_weapons( g, g->wp ); 199 draw_explosions( g, g->ex );200 205 201 206 /* Refresh */
Note: See TracChangeset
for help on using the changeset viewer.