Add idle animation
This commit is contained in:
@@ -40,15 +40,13 @@ bool initEntityObjectsLayer(BzTileMap *map, BzTileObjectGroup *objectGroup) {
|
||||
ecs_set(ECS, e, SteeringOutput, {});
|
||||
ecs_set(ECS, e, TextureRegion, {objectTileset->tiles, bzTilesetGetTileRegion(objectTileset, object.gid)});
|
||||
ecs_set(ECS, e, Animation, {
|
||||
.firstFrame=(TextureRegion) {
|
||||
objectTileset->tiles,
|
||||
bzTilesetGetTileRegion(objectTileset, object.gid + 1)
|
||||
},
|
||||
.currAnimation=ANIMATION_IDLE,
|
||||
.currFrame=0,
|
||||
.frameCount=4,
|
||||
.frameDuration=0.20f
|
||||
.entityType=ENTITY_WORKER,
|
||||
.tileset = objectTileset,
|
||||
.curFrame=0,
|
||||
.frameDuration=0.6f + (i % 10) * 0.05f,
|
||||
.elapsed=i * 0.1f,
|
||||
});
|
||||
ecs_set(ECS, e, AnimationType, {ANIM_IDLE});
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user