Tweak spatial grid size, add colliders rendering
This commit is contained in:
@@ -101,8 +101,8 @@ bool init(void *userData) {
|
||||
game->entityGrid = bzSpatialGridCreate(&(BzSpatialGridDesc) {
|
||||
.maxWidth=game->map.width * game->map.tileWidth,
|
||||
.maxHeight=game->map.height * game->map.tileHeight,
|
||||
.cellWidth=game->map.tileWidth * 5,
|
||||
.cellHeight=game->map.tileHeight * 5,
|
||||
.cellWidth=game->map.tileWidth * 4,
|
||||
.cellHeight=game->map.tileHeight * 4,
|
||||
.userDataSize=sizeof(ecs_entity_t)
|
||||
});
|
||||
|
||||
@@ -118,12 +118,15 @@ bool init(void *userData) {
|
||||
ECS_SYSTEM(ECS, updateAnimations, EcsOnUpdate, Animation, TextureRegion);
|
||||
ECS_SYSTEM(ECS, updatePos, EcsOnUpdate, Position, TargetPosition, TextureRegion);
|
||||
ECS_SYSTEM(ECS, entityUpdatePhysics, EcsOnUpdate, Position, Size, SpatialGridID);
|
||||
|
||||
ECS_SYSTEM(ECS, drawDebugPath, EcsOnUpdate, Path);
|
||||
|
||||
ECS_SYSTEM(ECS, renderTerrain, EcsOnUpdate, Position, Size, Rotation, TextureRegion, TextureTerrain);
|
||||
ECS_SYSTEM(ECS, renderBuildings, EcsOnUpdate, Position, Size, Rotation, TextureRegion, TextureBuildings);
|
||||
ECS_SYSTEM(ECS, renderEntities, EcsOnUpdate, Position, Size, Rotation, TextureRegion, TextureEntities);
|
||||
|
||||
ECS_SYSTEM(ECS, renderColliders, EcsOnUpdate, Position, Size);
|
||||
|
||||
ECS_OBSERVER(ECS, targetFinish, EcsOnRemove, TargetPosition);
|
||||
ECS_OBSERVER(ECS, startPath, EcsOnSet, Path);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user