From 8fdb9773b51fc269745062fa931fe851798e3022 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 29 Apr 2009 13:37:29 +0000 Subject: [PATCH] Spawn fewer bonus items, try to center sprites despite no longer having handle information in frames, and disable non-working weapons (the homing missile and the bomb). git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/ttyvaders/trunk@3429 92316355-f0b4-4df1-b90c-862c8a59935f --- src/aliens.c | 9 +++++---- src/intro.c | 4 ++-- src/main.c | 10 +++++----- src/player.c | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/aliens.c b/src/aliens.c index 072bf77..2386906 100644 --- a/src/aliens.c +++ b/src/aliens.c @@ -51,15 +51,15 @@ void draw_aliens(game *g, aliens *al) { case ALIEN_FOO: caca_set_frame(foo_sprite, al->img[i] % 5); - caca_blit(g->cv, al->x[i], al->y[i], foo_sprite, NULL); + caca_blit(g->cv, al->x[i] - 4, al->y[i] - 1, foo_sprite, NULL); break; case ALIEN_BAR: caca_set_frame(bar_sprite, al->img[i] % 2); - caca_blit(g->cv, al->x[i], al->y[i], bar_sprite, NULL); + caca_blit(g->cv, al->x[i] - 2, al->y[i] - 1, bar_sprite, NULL); break; case ALIEN_BAZ: caca_set_frame(baz_sprite, al->img[i] % 4); - caca_blit(g->cv, al->x[i], al->y[i], baz_sprite, NULL); + caca_blit(g->cv, al->x[i] - 2, al->y[i] - 1, baz_sprite, NULL); break; case ALIEN_NONE: break; @@ -78,7 +78,8 @@ void update_aliens(game *g, aliens *al) { add_explosion(g, g->ex, al->x[i], al->y[i], 0, 0, EXPLOSION_MEDIUM); al->type[i] = ALIEN_NONE; - add_bonus(g, g->bo, al->x[i], al->y[i], caca_rand(0,4) ? BONUS_GREEN : BONUS_LIFE); + if(caca_rand(0, 10) == 0) + add_bonus(g, g->bo, al->x[i], al->y[i], caca_rand(0, 4) ? BONUS_GREEN : BONUS_LIFE); } /* Update coordinates */ diff --git a/src/intro.c b/src/intro.c index 6847a53..ca226d9 100644 --- a/src/intro.c +++ b/src/intro.c @@ -16,8 +16,8 @@ #include #include -#ifndef M_PI -# define M_PI 3.14159265358979323846 +#ifndef M_PI +# define M_PI 3.14159265358979323846 #endif //#include diff --git a/src/main.c b/src/main.c index 2a43572..e958217 100644 --- a/src/main.c +++ b/src/main.c @@ -168,8 +168,8 @@ static void start_game (game *g) add_weapon(g, g->wp, (g->p->x - 2) << 4, g->p->y << 4, 0, -32, WEAPON_LASER); add_weapon(g, g->wp, (g->p->x + 3) << 4, g->p->y << 4, 0, -32, WEAPON_LASER); /* Extra schtuph */ - add_weapon(g, g->wp, (g->p->x - 2) << 4, g->p->y << 4, -24, -16, WEAPON_SEEKER); - add_weapon(g, g->wp, (g->p->x + 3) << 4, g->p->y << 4, 24, -16, WEAPON_SEEKER); + //add_weapon(g, g->wp, (g->p->x - 2) << 4, g->p->y << 4, -24, -16, WEAPON_SEEKER); + //add_weapon(g, g->wp, (g->p->x + 3) << 4, g->p->y << 4, 24, -16, WEAPON_SEEKER); /* More schtuph */ add_weapon(g, g->wp, (g->p->x - 1) << 4, (g->p->y - 1) << 4, 0, -32, WEAPON_LASER); add_weapon(g, g->wp, (g->p->x + 2) << 4, (g->p->y - 1) << 4, 0, -32, WEAPON_LASER); @@ -177,10 +177,10 @@ static void start_game (game *g) add_weapon(g, g->wp, g->p->x << 4, (g->p->y - 1) << 4, 0, -32, WEAPON_LASER); add_weapon(g, g->wp, (g->p->x + 1) << 4, (g->p->y - 1) << 4, 0, -32, WEAPON_LASER); /* Extra schtuph */ - add_weapon(g, g->wp, (g->p->x - 2) << 4, g->p->y << 4, -32, 0, WEAPON_SEEKER); - add_weapon(g, g->wp, (g->p->x + 3) << 4, g->p->y << 4, 32, 0, WEAPON_SEEKER); + //add_weapon(g, g->wp, (g->p->x - 2) << 4, g->p->y << 4, -32, -32, WEAPON_SEEKER); + //add_weapon(g, g->wp, (g->p->x + 3) << 4, g->p->y << 4, 32, -32, WEAPON_SEEKER); /* MORE SCHTUPH! */ - add_weapon(g, g->wp, g->p->x << 4, g->p->y << 4, 0, -16, WEAPON_BOMB); + //add_weapon(g, g->wp, g->p->x << 4, g->p->y << 4, 0, -16, WEAPON_BOMB); } break; } diff --git a/src/player.c b/src/player.c index ed53d8e..2efae20 100644 --- a/src/player.c +++ b/src/player.c @@ -53,7 +53,7 @@ void draw_player(game *g, player *p) return; caca_set_frame(ship_sprite, 0); - caca_blit(g->cv, p->x, p->y, ship_sprite, NULL); + caca_blit(g->cv, p->x - 2, p->y - 1, ship_sprite, NULL); } void update_player(game *g, player *p)