aboutsummaryrefslogtreecommitdiff
path: root/gst/gst.c
diff options
context:
space:
mode:
authorjacopo grandi <jak.sk8@hotmail.it>2021-03-05 16:54:26 +0100
committerjacopo grandi <jak.sk8@hotmail.it>2021-03-05 16:54:26 +0100
commitd1af4269c4130d11d77f61f1a2ac8f3e249f72f2 (patch)
tree05618430db0951262bd22e7bbe77b663c3c0346f /gst/gst.c
parent02e55b0647eb5c631e7d7669a13fd0d47ec26c15 (diff)
unit generator in hud, minor fix in movement, % in view and cost weights
Diffstat (limited to 'gst/gst.c')
-rw-r--r--gst/gst.c17
1 files changed, 12 insertions, 5 deletions
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);
+ }
}
}
}