From d1af4269c4130d11d77f61f1a2ac8f3e249f72f2 Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Fri, 5 Mar 2021 16:54:26 +0100 Subject: unit generator in hud, minor fix in movement, % in view and cost weights --- gst/gst.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gst/gst.c') diff --git a/gst/gst.c b/gst/gst.c index d3d4ee8..3b2576f 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -14,6 +14,7 @@ void gst_init (gamestate *gst) { gst->turn = 0; gst->coveredtime = 0; gst->turnspeed = 0.75; + gst->waitstep = 0; } void gst_destroy (gamestate *gst) { @@ -172,12 +173,18 @@ void gst_next_turn (gamestate *gst, infos *info, fxs *fx, float t) { gst_spawn_bullets(gst, fx, dmgs, fire, t); } -void gst_process (gamestate *gst, infos *info, fxs *fx, float t) { +void gst_process (gamestate *gst, infos *info, MKb *mkb, fxs *fx, float t) { if (gst->state == 1) { - if (gst->starttime > t) gst->starttime = t; - float t_elapsed = t-gst->starttime; - if (t_elapsed >= gst->coveredtime) { - gst_next_turn(gst, info, fx, t); + if (gst->waitstep) { + if (mkb_search(mkb, SDL_SCANCODE_SPACE)) { + gst_next_turn(gst, info, fx, t); + } + } else { + if (gst->starttime > t) gst->starttime = t; + float t_elapsed = t-gst->starttime; + if (t_elapsed >= gst->coveredtime) { + gst_next_turn(gst, info, fx, t); + } } } } -- cgit v1.2.3-54-g00ecf