Add rest of assets, add blue player
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user