Noah2610 / deathfloor

Work-in-progress Mega Man inspired game.
MIT License
2 stars 0 forks source link

Add DeathAfterDelay component #67

Closed Noah2610 closed 4 years ago

Noah2610 commented 4 years ago

Component that makes the entity die after a given delay. Sets the entity's Lifecycle state to Death after delay.

Replace player bullet despawning (DeleteBulletsSystem) and custom entity deletion events (like with Custom(DischargeProjectile) with this.

Noah2610 commented 4 years ago

The Bullet component no longer has a despawn_after_ms field. Bullets themselves won't despawn on their own now. Instead, give bullets the DespawnAfterDelay component.

components: (
    bullet: (), // this is kinda useless,
                // it just marks this entity as a bullet.
                // maybe this will become useful later on,
                // but for now this does basically nothing.
    despawn_after_delay: (
        delay_ms: 5000,
    ),
),