aboutsummaryrefslogtreecommitdiff
path: root/src/effect.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-11 23:11:21 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-11 23:11:21 +0100
commit4c4ffc1b84ada5dc47f9d36e9154564b68ff7fed (patch)
tree70ba7352bb0e9674923ce839578b33253059660c /src/effect.c
parent4a82c31f67d74be952a9e60506cde7ba31c15214 (diff)
downloadgold-mine-run-4c4ffc1b84ada5dc47f9d36e9154564b68ff7fed.tar.gz
gold-mine-run-4c4ffc1b84ada5dc47f9d36e9154564b68ff7fed.zip
Add gol/silver keys and door logic
Diffstat (limited to 'src/effect.c')
-rw-r--r--src/effect.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/effect.c b/src/effect.c
index a2e58c2..e9ee55e 100644
--- a/src/effect.c
+++ b/src/effect.c
@@ -1,4 +1,6 @@
#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "vga.h"
#include "entities.h"
@@ -21,6 +23,24 @@ static const Rect frames[2 * 4] =
{ 0, 0, 144, 144 }
};
+void effect_out_new(uint16_t x, uint16_t y)
+{
+ Entity *e = entities_new();
+#ifdef DEBUG
+ if (!e)
+ {
+ set_mode(3);
+ fprintf(stderr, "ERROR: run out of entities\n");
+ exit(1);
+ }
+#endif
+
+ e->x = x;
+ e->y = y;
+
+ effect_out_init(e);
+}
+
void effect_out_init(Entity *e)
{
e->frames = (const Rect *)frames;