diff options
| author | quou <quou@disroot.org> | 2024-10-01 20:56:18 +1000 | 
|---|---|---|
| committer | quou <quou@disroot.org> | 2024-10-01 20:56:18 +1000 | 
| commit | 7fd847dcd9f951a91747405be1f9bbba91d6cedd (patch) | |
| tree | fdde118b8d85ab407ddcd14c66161e035b1e413d /world.c | |
| parent | 61d70551166de46cfda7ee5d6212817859153335 (diff) | |
freeze frames when the player takes damage
Diffstat (limited to 'world.c')
| -rw-r--r-- | world.c | 5 | 
1 files changed, 5 insertions, 0 deletions
| @@ -6,6 +6,7 @@ void init_world(World* w) {  	w->enemy_count = 0;  	w->deathzone_count = 0;  	w->frame = 0; +	w->freeze = 0;  	init_player(&w->player);  } @@ -54,6 +55,10 @@ Deathzone* inst_deathzone(  void update_world(World* w, const App* a) {  	int i; +	if (w->freeze) { +		w->freeze--; +		return; +	}  	for (i = w->deathzone_count - 1; i >= 0; i--)  		if (update_deathzone(&w->deathzones[i]))  			w->deathzones[i] = w->deathzones[--w->deathzone_count]; |