aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-04 23:19:21 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-04 23:19:21 +0100
commit49379fe29f1e4a1ed19ada85db4c37909a611142 (patch)
treeb7b08b4481d67d408430de9536f6720da2a7341a
parent3bc9c114df783f37bd14339e3f29f80de97ad240 (diff)
downloadgold-mine-run-49379fe29f1e4a1ed19ada85db4c37909a611142.tar.gz
gold-mine-run-49379fe29f1e4a1ed19ada85db4c37909a611142.zip
Warp all the entities out
Used by the stage clear code.
-rw-r--r--src/entities.c12
-rw-r--r--src/entities.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/entities.c b/src/entities.c
index be976ea..df8fb4e 100644
--- a/src/entities.c
+++ b/src/entities.c
@@ -4,9 +4,10 @@
#include "vga.h"
#include "map.h"
#include "data.h"
-
#include "entities.h"
+#include "effect.h"
+
#define MAX_ENTITY 32
static Entity entities[MAX_ENTITY];
@@ -70,3 +71,12 @@ void entities_draw()
blitrc(binary_sprites_start, &e->frames[e->dir * 4 + e->frame], &dst);
}
}
+
+void entities_warp_out_all()
+{
+ Entity *e = entities;
+
+ for (uint8_t i = 0; i < last; i++, e++)
+ if (e->used)
+ effect_out_init(e);
+}
diff --git a/src/entities.h b/src/entities.h
index d7a6a83..99424de 100644
--- a/src/entities.h
+++ b/src/entities.h
@@ -32,4 +32,6 @@ void entities_update();
void entities_erase();
void entities_draw();
+void entities_warp_out_all();
+
#endif /* _ENTITIES_H */