From ace5c3f3093c50ff7fa6f8b281a377e3788abbd5 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Sun, 29 Aug 2021 13:57:41 +0200 Subject: adding techs --- game/view.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 11 deletions(-) (limited to 'game/view.cpp') diff --git a/game/view.cpp b/game/view.cpp index 6599a0e..d00fd2a 100644 --- a/game/view.cpp +++ b/game/view.cpp @@ -19,49 +19,88 @@ void View::process (Gst &gst, vec2 cam, vec2 mouse, int *mheld) { for (int i=0; iunit == 1) { + valid = 0; + } + } + if (!valid) continue; vec2 pos { (float)x*32, (float)y*32 }; if (pos.x < absmouse.x && absmouse.x < pos.x+32 && pos.y < absmouse.y && absmouse.y < pos.y+32) { cursor_ground = moves[i]; - found = true; } } + found = true; + } + + if (attacks.size() > 0 && !found) { + for (int i=0; iunit == 1) { + found = true; + } } } + if (cursor_entity != -1) found = true; + for (int y=0; y