Missile launching tweaks. Slight delay before start chasing.
This commit is contained in:
parent
dcb0cf8450
commit
1ee41e0993
|
@ -93,7 +93,10 @@ void doBullets(void)
|
||||||
{
|
{
|
||||||
addMissileEngineEffect(b);
|
addMissileEngineEffect(b);
|
||||||
|
|
||||||
huntTarget(b);
|
if (b->life < MISSILE_LIFE - (FPS / 2))
|
||||||
|
{
|
||||||
|
huntTarget(b);
|
||||||
|
}
|
||||||
|
|
||||||
if (b->target == player && player != NULL && player->health > 0)
|
if (b->target == player && player != NULL && player->health > 0)
|
||||||
{
|
{
|
||||||
|
@ -402,7 +405,10 @@ void fireMissile(Entity *owner)
|
||||||
|
|
||||||
b = createBullet(BT_MISSILE, owner->x, owner->y, owner);
|
b = createBullet(BT_MISSILE, owner->x, owner->y, owner);
|
||||||
|
|
||||||
b->life = FPS * 30;
|
b->dx *= 0.5;
|
||||||
|
b->dy *= 0.5;
|
||||||
|
|
||||||
|
b->life = MISSILE_LIFE;
|
||||||
|
|
||||||
owner->missiles--;
|
owner->missiles--;
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define TURN_THRESHOLD 3
|
#define TURN_THRESHOLD 3
|
||||||
#define INITIAL_BULLET_DRAW_CAPACITY 32
|
#define INITIAL_BULLET_DRAW_CAPACITY 32
|
||||||
|
|
||||||
|
#define MISSILE_LIFE (FPS * 30)
|
||||||
|
|
||||||
extern SDL_Texture *getTexture(char *filename);
|
extern SDL_Texture *getTexture(char *filename);
|
||||||
extern void blitRotated(SDL_Texture *texture, int x, int y, float angle);
|
extern void blitRotated(SDL_Texture *texture, int x, int y, float angle);
|
||||||
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
|
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
|
||||||
|
|
Loading…
Reference in New Issue