completed animation setup and code based solely on LDTK settings

This commit is contained in:
2024-04-03 19:39:08 +02:00
parent 001b67f97a
commit f844058bf9
13 changed files with 262 additions and 172 deletions

View File

@@ -159,6 +159,15 @@ func NewGrid(world *ecs.World,
render.Image = tile.Sprite
render.Pos = pos
//if tile.AnimateOnDestruct {
if tile.AnimationTrigger != "" {
// FIXME: be more generic, use LDTK enum
render.Animate.Tiles = tile.AnimationSpriteSheet.Sprites
render.Animate.Width = tile.AnimationSpriteSheet.Width
render.Animate.Height = tile.AnimationSpriteSheet.Height
render.Animate.Trigger = tile.AnimationTrigger
}
default:
// empty cell, this is where the player[s] move. No
// sprite required since every level has a background