mirror of
https://github.com/zoriya/Twac.git
synced 2025-12-05 22:26:11 +00:00
Adding a win screen
This commit is contained in:
Submodule lib/gamacon updated: ac5fab3d40...ac4137fb54
9
prefabs/winscreen.gcprefab
Normal file
9
prefabs/winscreen.gcprefab
Normal 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>
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "components/transform_component.h"
|
||||
#include "components/win_component.h"
|
||||
#include "utility.h"
|
||||
#include "prefab.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user