From e48fb343fc907be71051cf089a849416b4310f09 Mon Sep 17 00:00:00 2001 From: Anonymus Raccoon Date: Sat, 11 Jan 2020 19:01:59 +0100 Subject: [PATCH] Adding a win screen --- lib/gamacon | 2 +- prefabs/winscreen.gcprefab | 9 +++++++++ src/components/live_component.c | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 prefabs/winscreen.gcprefab diff --git a/lib/gamacon b/lib/gamacon index ac5fab3..ac4137f 160000 --- a/lib/gamacon +++ b/lib/gamacon @@ -1 +1 @@ -Subproject commit ac5fab3d4062f8144dd9157dd46949255ea2c2ef +Subproject commit ac4137fb5481a78507c39e623b7b446acebbbdd7 diff --git a/prefabs/winscreen.gcprefab b/prefabs/winscreen.gcprefab new file mode 100644 index 0000000..11a090f --- /dev/null +++ b/prefabs/winscreen.gcprefab @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/components/live_component.c b/src/components/live_component.c index d92b413..8190b72 100644 --- a/src/components/live_component.c +++ b/src/components/live_component.c @@ -12,6 +12,7 @@ #include "components/transform_component.h" #include "components/win_component.h" #include "utility.h" +#include "prefab.h" #include static void on_collide(gc_engine *engine, gc_entity *entity, int id) @@ -28,7 +29,8 @@ static void on_collide(gc_engine *engine, gc_entity *entity, int id) } } if (GETCOLCMP(win_component)) { - engine->should_close = true; + prefab_load(engine, "prefabs/winscreen.gcprefab"); + entity->remove_component(engine->scene, entity, "keyboard_controller"); } }