Add area and flag on physics

This commit is contained in:
2026-07-20 12:31:14 -05:00
parent 373f1c1010
commit b9f06fef7a
27 changed files with 1956 additions and 114 deletions
+24
View File
@@ -34,6 +34,19 @@ errorret_t gameInit(void) {
assetUnlockEntry(sceneEntry);
errorChain(ret);
// Test-only: print a debug message whenever an entity enters "testArea"
// (see assets/scenes/test.json), exercising the TRIGGER component.
entitymanager_t *mgr = sceneGetEntities(testSceneId);
entityid_t testAreaEntity = entityFindByName(mgr, "testArea");
if(testAreaEntity != ENTITY_ID_INVALID) {
componentid_t testAreaTrig = entityGetComponent(
mgr, testAreaEntity, COMPONENT_TYPE_TRIGGER
);
entityTriggerOnEnterAdd(
mgr, testAreaEntity, testAreaTrig, gameTestAreaOnEnter, NULL
);
}
sceneSetActive(testSceneId);
errorOk();
}
@@ -45,3 +58,14 @@ errorret_t gameUpdate(void) {
errorret_t gameDispose(void) {
errorOk();
}
void gameTestAreaOnEnter(
entitymanager_t *mgr,
const entityid_t triggerEntityId,
const componentid_t triggerComponentId,
const entityid_t otherEntityId,
const componentid_t otherComponentId,
void *user
) {
logDebug("testArea: entity %d entered", otherEntityId);
}