Fix downward dash not damaging enemies and add post-dash invincibility
Stomping was guarded by the invincibility check, so during a downward dash the player could never deal stomp damage. Move the invincibility guard to only protect against taking damage, not dealing it. Extend dash invincibility by PLAYER_DASH_INV_GRACE (0.15s) past the dash duration so the player is briefly protected after landing. Closes #15
This commit was merged in pull request #26.
This commit is contained in:
@@ -308,8 +308,8 @@ void player_update(Entity *self, float dt, const Tilemap *map) {
|
||||
pd->dash_timer = PLAYER_DASH_DURATION;
|
||||
pd->dash_dir = vec2(0.0f, 1.0f);
|
||||
|
||||
/* Brief invincibility during dash */
|
||||
pd->inv_timer = PLAYER_DASH_DURATION;
|
||||
/* Invincibility during dash + short grace period after */
|
||||
pd->inv_timer = PLAYER_DASH_DURATION + PLAYER_DASH_INV_GRACE;
|
||||
self->flags |= ENTITY_INVINCIBLE;
|
||||
|
||||
/* Jetpack burst downward */
|
||||
|
||||
Reference in New Issue
Block a user