Decoration updates.
This commit is contained in:
parent
8c9ee4f553
commit
683746b239
|
@ -34,6 +34,8 @@ void initDebris(Decoration *d)
|
||||||
|
|
||||||
d->effectType = rand() % 2;
|
d->effectType = rand() % 2;
|
||||||
|
|
||||||
|
d->spriteFrame = 0;
|
||||||
|
|
||||||
d->flags |= EF_BOUNCES | EF_IGNORE_BULLETS | EF_KILL_OFFSCREEN | EF_NO_TELEPORT;
|
d->flags |= EF_BOUNCES | EF_IGNORE_BULLETS | EF_KILL_OFFSCREEN | EF_NO_TELEPORT;
|
||||||
|
|
||||||
d->tick = tick;
|
d->tick = tick;
|
||||||
|
|
|
@ -34,6 +34,8 @@ void initFleshChunk(Decoration *d)
|
||||||
|
|
||||||
d->bleedTime = FPS * 3;
|
d->bleedTime = FPS * 3;
|
||||||
|
|
||||||
|
d->spriteFrame = 0;
|
||||||
|
|
||||||
d->tick = tick;
|
d->tick = tick;
|
||||||
d->action = action;
|
d->action = action;
|
||||||
d->touch = touch;
|
d->touch = touch;
|
||||||
|
|
|
@ -34,10 +34,6 @@ void initEffects(void)
|
||||||
debris[2] = getSprite("Debris3");
|
debris[2] = getSprite("Debris3");
|
||||||
}
|
}
|
||||||
|
|
||||||
void addExplosionEffect(int x, int y, float dx, float dy)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void addSmallFleshChunk(float x, float y)
|
void addSmallFleshChunk(float x, float y)
|
||||||
{
|
{
|
||||||
Decoration *chunk;
|
Decoration *chunk;
|
||||||
|
@ -48,12 +44,8 @@ void addSmallFleshChunk(float x, float y)
|
||||||
|
|
||||||
chunk->x = x;
|
chunk->x = x;
|
||||||
chunk->y = y;
|
chunk->y = y;
|
||||||
chunk->dx = 0;
|
|
||||||
chunk->dy = 0;
|
|
||||||
chunk->health = FPS / 4;
|
chunk->health = FPS / 4;
|
||||||
chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[0];
|
chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[0];
|
||||||
|
|
||||||
chunk->spriteFrame = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void throwFleshChunks(float x, float y, int amount)
|
void throwFleshChunks(float x, float y, int amount)
|
||||||
|
@ -73,12 +65,25 @@ void throwFleshChunks(float x, float y, int amount)
|
||||||
chunk->dy = -rrnd(10, 15);
|
chunk->dy = -rrnd(10, 15);
|
||||||
chunk->health = FPS * rrnd(3, 12);
|
chunk->health = FPS * rrnd(3, 12);
|
||||||
chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[i % 3];
|
chunk->sprite[0] = chunk->sprite[1] = chunk->sprite[2] = fleshChunk[i % 3];
|
||||||
|
|
||||||
chunk->spriteFrame = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void throwDebris(float x, float y, int amount)
|
void throwDebris(float x, float y, int amount)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
Decoration *piece;
|
||||||
|
|
||||||
|
for (i = 0; i < amount; i++)
|
||||||
|
{
|
||||||
|
piece = malloc(sizeof(Decoration));
|
||||||
|
memset(piece, 0, sizeof(Decoration));
|
||||||
|
initDebris(piece);
|
||||||
|
|
||||||
|
piece->x = x;
|
||||||
|
piece->y = y;
|
||||||
|
piece->dx = rrnd(-2, 2);
|
||||||
|
piece->dy = -rrnd(10, 15);
|
||||||
|
piece->health = FPS * (rand() % 3);
|
||||||
|
piece->sprite[0] = piece->sprite[1] = piece->sprite[2] = debris[i % 3];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,5 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
extern int rrnd(int low, int high);
|
extern int rrnd(int low, int high);
|
||||||
extern Sprite *getSprite(char *name);
|
extern Sprite *getSprite(char *name);
|
||||||
extern void initFleshChunk(Decoration *d);
|
extern void initFleshChunk(Decoration *d);
|
||||||
|
extern void initDebris(Decoration *d);
|
||||||
|
|
||||||
extern World world;
|
extern World world;
|
||||||
|
|
Loading…
Reference in New Issue