summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-11-10 10:34:58 -0800
committerVito Caputo <vcaputo@pengaru.com>2022-11-10 10:34:58 -0800
commitc39fa92a14ed10e34a5427e1a6e19ea92a6b4890 (patch)
tree78602cae379d04750a1513d7335cc52f10f93a26 /src
parentf3c9cb72b59802df220529bc20c907d2a11b5f78 (diff)
game: stub ou ta win condition on >256 TP rolls
For now this just does the same thing as dying, I need to either animate something interesting or add a .ans to show something celebratory like the monkey sitting on a mountain of TP.
Diffstat (limited to 'src')
-rw-r--r--src/game.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game.c b/src/game.c
index 8bc8675..62306ed 100644
--- a/src/game.c
+++ b/src/game.c
@@ -62,6 +62,8 @@
#define GAME_TV_RANGE_MAX .7f
#define GAME_TV_ATTRACTION .005f
+#define GAME_TP_WIN_THRESHOLD 256
+
#define GAME_KBD_DELAY_MS 20
#define GAME_KBD_TIMER PLAY_TICKS_TIMER4
@@ -86,7 +88,8 @@ typedef enum game_state_t {
GAME_STATE_PLAYING,
GAME_STATE_OVER,
GAME_STATE_OVER_DELAY,
- GAME_STATE_OVER_WAITING
+ GAME_STATE_OVER_WAITING,
+ GAME_STATE_OVER_WINNING,
} game_state_t;
typedef enum entity_type_t {
@@ -375,6 +378,8 @@ static void more_teepee(game_t *game, teepee_t *teepee)
tp->entity.model_x = m4f_translate(NULL, &(v3f_t){ .x = ((game->teepee_cnt % 16) * 0.0625f) * 1.9375f + -.9375f, .y = (.9687f - ((game->teepee_cnt / 16) * 0.0625f)) * 1.9375f + -.9375f, .z = 0.f });
tp->entity.model_x = m4f_scale(&tp->entity.model_x, &tp->entity.scale);
game->teepee_cnt++;
+ if (game->teepee_cnt >= GAME_TP_WIN_THRESHOLD)
+ game->state = GAME_STATE_OVER_WINNING;
}
(*teepee->bonus_release) = BONUS_NODE_RELEASE_MS;
(*teepee->bonus_release_position) = teepee->entity.position;
@@ -997,6 +1002,7 @@ static void game_update(play_t *play, void *context)
}
case GAME_STATE_OVER:
+ case GAME_STATE_OVER_WINNING: /* TODO: make this a distinct state with a win animation */
show_score(game);
play_ticks_reset(play, GAME_OVER_TIMER);
game->state = GAME_STATE_OVER_DELAY;
© All Rights Reserved