summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-03-25 19:13:34 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-03-25 19:13:34 (EDT)
commit81de78c6de8adf57bb713ea396a94bcfdd8ad035 (patch)
treefd02481f597b85cca1c50775940964a5e4be689e
parent78aff7ae4b05b5a77931ac4e68c814f48ce22460 (diff)
downloaddodge-balls-81de78c6de8adf57bb713ea396a94bcfdd8ad035.zip
dodge-balls-81de78c6de8adf57bb713ea396a94bcfdd8ad035.tar.gz
dodge-balls-81de78c6de8adf57bb713ea396a94bcfdd8ad035.tar.bz2
map: Set random angle for spinning balls
-rw-r--r--src/map.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/map.c b/src/map.c
index 3f3a6f9..e4ee0b9 100644
--- a/src/map.c
+++ b/src/map.c
@@ -447,10 +447,12 @@ _db_tmx_object_property_start(void *pv, const char *name, const char **attr)
db_dbg(" Object direction: "
"random");
} else if (strcmp(dir, "cw") == 0) {
+ map->obj_a = rand() / (RAND_MAX / 360);
map->obj_d = -1;
db_dbg(" Object direction: "
"clockwise");
} else if (strcmp(dir, "ccw") == 0) {
+ map->obj_a = rand() / (RAND_MAX / 360);
map->obj_d = 1;
db_dbg(" Object direction: "
"counter-clockwise");