Add rest of assets, add blue player

This commit is contained in:
2024-01-23 11:26:23 +01:00
parent ac7525c42a
commit c9a2bd2672
45 changed files with 6647 additions and 39 deletions

View File

@@ -45,10 +45,23 @@ void entityPathRemove(ecs_iter_t *it) {
}
}
void updateTextureOwnerTile(ecs_iter_t *it) {
TextureRegion *tex = ecs_field(it, TextureRegion, 1);
Owner *owner = ecs_field(it, Owner, 2);
for (i32 i = 0; i < it->count; i++) {
Rectangle rec = tex[i].rec;
BzTileID base = ((int)rec.y / 16) * 256 + ((int) rec.x / 16);
Vector2 offset = getTileOffset(base, owner[i].player);
tex[i].rec.x += offset.x;
tex[i].rec.y += offset.y;
}
}
void entityUpdateSpatialID(ecs_iter_t *it) {
Game *game = ecs_singleton_get_mut(ECS, Game);
Position *position = ecs_field(it, Position, 1);
Position *size = ecs_field(it, Position, 2);
Position *size = ecs_field(it, Size, 2);
//Velocity *velocity = ecs_field(it, Velocity, 3);
SpatialGridID *id = ecs_field(it, SpatialGridID, 4);