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-862c8a59935fmaster
@@ -51,15 +51,15 @@ void draw_aliens(game *g, aliens *al) | |||||
{ | { | ||||
case ALIEN_FOO: | case ALIEN_FOO: | ||||
caca_set_frame(foo_sprite, al->img[i] % 5); | 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; | break; | ||||
case ALIEN_BAR: | case ALIEN_BAR: | ||||
caca_set_frame(bar_sprite, al->img[i] % 2); | 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; | break; | ||||
case ALIEN_BAZ: | case ALIEN_BAZ: | ||||
caca_set_frame(baz_sprite, al->img[i] % 4); | 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; | break; | ||||
case ALIEN_NONE: | case ALIEN_NONE: | ||||
break; | 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); | add_explosion(g, g->ex, al->x[i], al->y[i], 0, 0, EXPLOSION_MEDIUM); | ||||
al->type[i] = ALIEN_NONE; | 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 */ | /* Update coordinates */ | ||||
@@ -16,8 +16,8 @@ | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <math.h> | #include <math.h> | ||||
#ifndef M_PI | |||||
# define M_PI 3.14159265358979323846 | |||||
#ifndef M_PI | |||||
# define M_PI 3.14159265358979323846 | |||||
#endif | #endif | ||||
//#include <unistd.h> | //#include <unistd.h> | ||||
@@ -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 - 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); | add_weapon(g, g->wp, (g->p->x + 3) << 4, g->p->y << 4, 0, -32, WEAPON_LASER); | ||||
/* Extra schtuph */ | /* 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 */ | /* 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 - 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); | 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 << 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); | add_weapon(g, g->wp, (g->p->x + 1) << 4, (g->p->y - 1) << 4, 0, -32, WEAPON_LASER); | ||||
/* Extra schtuph */ | /* 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! */ | /* 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; | break; | ||||
} | } | ||||
@@ -53,7 +53,7 @@ void draw_player(game *g, player *p) | |||||
return; | return; | ||||
caca_set_frame(ship_sprite, 0); | 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) | void update_player(game *g, player *p) | ||||