From 5f2f8163b02c6618bcb67f86bb0b01ead376698b Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 17 Oct 2022 13:35:56 -0700 Subject: game: s/update_viruses/update_entities/ This name already doesn't quite reflect what's happening since the addition of the TV. There will be more non-viruses stuff added to this function only making the existing name even more wrong. Renaming for better accuracy along with the associated timer's symbolic constants. No functional changes... --- src/game.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/game.c b/src/game.c index 990ebf3..b8d8b73 100644 --- a/src/game.c +++ b/src/game.c @@ -45,8 +45,8 @@ #define GAME_VIRUS_SPEED .01f #define GAME_ADULT_SPEED .04f -#define GAME_VIRUS_DELAY_MS 20 -#define GAME_VIRUS_TIMER PLAY_TICKS_TIMER1 +#define GAME_ENTITIES_DELAY_MS 20 +#define GAME_ENTITIES_TIMER PLAY_TICKS_TIMER1 #define GAME_TV_DELAY_MS 3000 #define GAME_TV_TIMER PLAY_TICKS_TIMER3 @@ -305,7 +305,7 @@ static ix2_search_status_t virus_search(void *cb_context, ix2_object_t *ix2_obje * and the virus respawns somewhere * - if the newly infected thing is the adult, the game ends */ -static void update_viruses(play_t *play, game_t *game) +static void update_entities(play_t *play, game_t *game) { virus_search_t search = { .game = game }; @@ -535,7 +535,7 @@ static void game_enter(play_t *play, void *context) assert(game); play_music_set(play, PLAY_MUSIC_FLAG_LOOP|PLAY_MUSIC_FLAG_IDEMPOTENT, "assets/game.ogg"); - play_ticks_reset(play, GAME_VIRUS_TIMER); + play_ticks_reset(play, GAME_ENTITIES_TIMER); stage_set_active(game->plasma_node, 1); reset_game(game); } @@ -551,8 +551,8 @@ static void game_update(play_t *play, void *context) switch (game->state) { case GAME_STATE_PLAYING: { - if (play_ticks_elapsed(play, GAME_VIRUS_TIMER, GAME_VIRUS_DELAY_MS)) - update_viruses(play, game); + if (play_ticks_elapsed(play, GAME_ENTITIES_TIMER, GAME_ENTITIES_DELAY_MS)) + update_entities(play, game); if (play_ticks_elapsed(play, GAME_KBD_TIMER, GAME_KBD_DELAY_MS)) { const Uint8 *key_state = SDL_GetKeyboardState(NULL); -- cgit v1.2.3