Adding a win screen

This commit is contained in:
Anonymus Raccoon
2020-01-11 19:01:59 +01:00
parent 4306ce6584
commit e48fb343fc
3 changed files with 13 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
<gc_entities>
<gc_entity>
<transform_component />
<renderer text="Congratulation, you won." />
<fixed_to_cam>
<Position x="200" y="100" />
</fixed_to_cam>
</gc_entity>
</gc_entities>

View File

@@ -12,6 +12,7 @@
#include "components/transform_component.h" #include "components/transform_component.h"
#include "components/win_component.h" #include "components/win_component.h"
#include "utility.h" #include "utility.h"
#include "prefab.h"
#include <stdlib.h> #include <stdlib.h>
static void on_collide(gc_engine *engine, gc_entity *entity, int id) 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)) { if (GETCOLCMP(win_component)) {
engine->should_close = true; prefab_load(engine, "prefabs/winscreen.gcprefab");
entity->remove_component(engine->scene, entity, "keyboard_controller");
} }
} }