summaryrefslogtreecommitdiff
path: root/src/objects.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects.c')
-rw-r--r--src/objects.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/objects.c b/src/objects.c
index 6715e0d..2084b4d 100644
--- a/src/objects.c
+++ b/src/objects.c
@@ -38,6 +38,17 @@ object get_object_at_tile(float x, float y) {
return (object){0};
}
+void add_object(object obj) {
+ for (int i = 0; i < MAX_OBJECTS; i++) {
+ object o = map_to_load.objects[i];
+ if (o.active) continue;
+ map_to_load.objects[i] = obj;
+ map_to_load.objects[i].active = true;
+ return;
+ }
+ log_info("OBJECT LIMIT REACHED!");
+}
+
image* get_image_from_objecttype(object_type tile) {
switch (tile)
{