Changeset 58 for ttyvaders/trunk
- Timestamp:
- Dec 23, 2002, 2:13:04 PM (20 years ago)
- Location:
- ttyvaders/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/src/common.h
r52 r58 4 4 * All Rights Reserved 5 5 * 6 * $Id: common.h,v 1.1 1 2002/12/23 10:06:27sam Exp $6 * $Id: common.h,v 1.12 2002/12/23 13:13:04 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 103 103 { 104 104 int x, y; 105 int dir;105 int vx, vy; 106 106 int weapon, nuke; 107 107 -
ttyvaders/trunk/src/main.c
r56 r58 4 4 * All Rights Reserved 5 5 * 6 * $Id: main.c,v 1.1 2 2002/12/23 12:47:36sam Exp $6 * $Id: main.c,v 1.13 2002/12/23 13:13:04 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 99 99 break; 100 100 case 'h': 101 g->p-> dir = -3;101 g->p->vx = -2; 102 102 break; 103 103 case 'j': … … 108 108 break; 109 109 case 'l': 110 g->p-> dir = 3;110 g->p->vx = 2; 111 111 break; 112 112 case 'n': -
ttyvaders/trunk/src/player.c
r38 r58 4 4 * All Rights Reserved 5 5 * 6 * $Id: player.c,v 1. 4 2002/12/22 18:44:12sam Exp $6 * $Id: player.c,v 1.5 2002/12/23 13:13:04 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 32 32 p->x = g->w / 2; 33 33 p->y = g->h - 2; 34 p->dir = 0; 34 p->vx = 0; 35 p->vy = 0; 35 36 p->weapon = 0; 36 37 p->nuke = 0; … … 72 73 } 73 74 74 if( p->dir < 0 ) 75 p->x += p->vx; 76 77 if( p->vx < 0 ) 75 78 { 76 if( p->dir == -3 && p->x > -2 ) p->x -= 1; 77 else if( p->x > -1 ) p->x -= 1; 79 p->vx++; 80 } 81 else if( p->vx > 0 ) 82 { 83 p->vx--; 84 } 78 85 79 p->dir++; 86 if( p->x < 1 ) 87 { 88 p->x = 1; 80 89 } 81 else if( p-> dir > 0)90 else if( p->x > g->w - 7 ) 82 91 { 83 if( p->dir == 3 && p->x < g->w - 8 ) p->x += 1; 84 else if( p->x < g->w - 7 ) p->x += 1; 85 p->dir--; 92 p->x = g->w - 7; 86 93 } 87 94 }
Note: See TracChangeset
for help on using the changeset viewer.