summaryrefslogtreecommitdiff
path: root/tower.h
diff options
context:
space:
mode:
authorriton <riton@riton.home>2025-03-29 21:37:46 +0300
committerriton <riton@riton.home>2025-03-29 21:37:46 +0300
commit1b6ecc22e77b7aa1fee16420b041c1dea1925052 (patch)
tree6816b0d3ebcfa30492371233fcce253ef5275f31 /tower.h
init repoHEADmaster
Diffstat (limited to 'tower.h')
-rw-r--r--tower.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/tower.h b/tower.h
new file mode 100644
index 0000000..e5801c1
--- /dev/null
+++ b/tower.h
@@ -0,0 +1,29 @@
+#ifndef KULE_H
+#define KULE_H
+
+#include <raylib.h>
+
+typedef struct Tower {
+ Texture2D* texture;
+ int damage;
+ int range;
+ Vector2 position;
+ Vector2 size;
+ Vector2 center;
+ float cooldown;
+ float cooldown_max;
+} tower_t;
+
+extern Sound BEAM_SOUND;
+typedef struct TowerBeam {
+ Vector2 dest;
+ Vector2 src;
+ float live_time;
+} tower_beam_t;
+
+tower_t make_tower(int damage, int range, int x, int y, int width, int height, Texture2D *texture);
+tower_beam_t make_beam(Vector2 src, Vector2 dest, float live_time);
+void draw_tower(tower_t *tower);
+void update_tower(tower_t *t, float dt);
+
+#endif