Browse Source

* src/weapons.c data/weapon_fragbomb:

+ Drew the fragbomb sprite.
    + Use the fragbomb in src/weapons.c.


git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/ttyvaders/trunk@144 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 21 years ago
parent
commit
bbb089ccf5
3 changed files with 59 additions and 88 deletions
  1. +1
    -0
      data/Makefile.am
  2. +50
    -0
      data/weapon_fragbomb
  3. +8
    -88
      src/weapons.c

+ 1
- 0
data/Makefile.am View File

@@ -8,4 +8,5 @@ EXTRA_DIST = \
item_gem \ item_gem \
item_heart \ item_heart \
weapon_bomb \ weapon_bomb \
weapon_fragbomb \
$(NULL) $(NULL)

+ 50
- 0
data/weapon_fragbomb View File

@@ -0,0 +1,50 @@
6 3 2 1
,--.
( ', )
`--'
jjjj
eejjee
eeee
6 3 2 1
,--.
( ', )
`--'
eeee
jjeejj
jjjj
4 4 1 -2
O o
: o
. :
.
j j
h j
h h
h
4 4 1 -2
O
o :
. :
.
j
j h
h h
h
4 4 1 -2
o O
o
: .
.
j j
j
h h
h
4 4 1 -2
o O
: o
:
.
j j
h j
h
h

+ 8
- 88
src/weapons.c View File

@@ -32,6 +32,7 @@ static void draw_beam(int x, int y, int frame);
static void draw_fragbomb(int x, int y, int frame); static void draw_fragbomb(int x, int y, int frame);


struct ee_sprite *bomb_sprite; struct ee_sprite *bomb_sprite;
struct ee_sprite *fragbomb_sprite;


void init_weapons(game *g, weapons *wp) void init_weapons(game *g, weapons *wp)
{ {
@@ -43,6 +44,7 @@ void init_weapons(game *g, weapons *wp)
} }


bomb_sprite = ee_load_sprite("data/weapon_bomb"); bomb_sprite = ee_load_sprite("data/weapon_bomb");
fragbomb_sprite = ee_load_sprite("data/weapon_fragbomb");
} }


void draw_weapons(game *g, weapons *wp) void draw_weapons(game *g, weapons *wp)
@@ -347,95 +349,13 @@ static void draw_bomb(int x, int y, int vx, int vy)


static void draw_fragbomb(int x, int y, int frame) static void draw_fragbomb(int x, int y, int frame)
{ {
ee_color(EE_WHITE);

ee_color(frame & 1 ? EE_CYAN : EE_WHITE);
ee_goto(x-2, y);
ee_putstr("( )");
ee_goto(x-1, y+1);
ee_putstr("`--'");

ee_color(frame & 1 ? EE_WHITE : EE_CYAN);
ee_goto(x-1, y-1);
ee_putstr(",--.");
ee_goto(x, y);
ee_putstr("',");
/* Draw the head */
ee_set_sprite_frame(fragbomb_sprite, frame & 1);
ee_draw_sprite(x, y, fragbomb_sprite);


switch(frame % 4)
{
case 0:
ee_color(EE_CYAN);
ee_goto(x, y + 2);
ee_putchar('O');
ee_goto(x + 2, y + 2);
ee_putchar('o');
ee_goto(x + 1, y + 3);
ee_putchar('o');
ee_color(EE_GRAY);
ee_goto(x - 1, y + 3);
ee_putchar(':');
ee_goto(x + 2, y + 4);
ee_putchar(':');
ee_goto(x, y + 4);
ee_putchar('.');
ee_goto(x + 1, y + 5);
ee_putchar('.');
break;
case 1:
ee_color(EE_CYAN);
//ee_goto(x, y + 1);
//ee_putchar('O');
ee_goto(x + 1, y + 2);
ee_putchar('O');
ee_goto(x, y + 3);
ee_putchar('o');
ee_color(EE_GRAY);
ee_goto(x + 2, y + 3);
ee_putchar(':');
ee_goto(x + 1, y + 4);
ee_putchar(':');
ee_goto(x - 1, y + 4);
ee_putchar('.');
ee_goto(x + 2, y + 5);
ee_putchar('.');
break;
case 2:
ee_color(EE_CYAN);
//ee_goto(x - 1, y + 1);
//ee_putchar('O');
ee_goto(x + 2, y + 2);
ee_putchar('O');
ee_goto(x, y + 2);
ee_putchar('o');
ee_goto(x + 1, y + 3);
ee_putchar('o');
ee_color(EE_GRAY);
ee_goto(x, y + 4);
ee_putchar(':');
ee_goto(x + 2, y + 4);
ee_putchar('.');
ee_goto(x + 1, y + 5);
ee_putchar('.');
break;
case 3:
ee_color(EE_CYAN);
//ee_goto(x + 2, y + 1);
//ee_putchar('O');
ee_goto(x + 1, y + 2);
ee_putchar('O');
ee_goto(x - 1, y + 2);
ee_putchar('o');
ee_goto(x + 2, y + 3);
ee_putchar('o');
ee_color(EE_GRAY);
ee_goto(x, y + 3);
ee_putchar(':');
ee_goto(x + 1, y + 4);
ee_putchar(':');
ee_goto(x, y + 5);
ee_putchar('.');
break;
}
/* Draw the tail */
ee_set_sprite_frame(fragbomb_sprite, 2 + (frame % 4));
ee_draw_sprite(x, y, fragbomb_sprite);
} }


static void draw_beam(int x, int y, int frame) static void draw_beam(int x, int y, int frame)


Loading…
Cancel
Save