switched to go coded animation system, LDTK is not used for this anymore
This commit is contained in:
25
grid/grid.go
25
grid/grid.go
@@ -159,13 +159,24 @@ 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.Sprites = tile.AnimationSpriteSheet.Sprites
|
||||
render.Animate.Width = tile.AnimationSpriteSheet.Width
|
||||
render.Animate.Height = tile.AnimationSpriteSheet.Height
|
||||
render.Animate.Trigger = tile.AnimationTrigger
|
||||
if tile.Animation.OnCollision {
|
||||
render.CollisionAnimate.Sprites = tile.Animation.CollisionSheet.Sprites
|
||||
render.CollisionAnimate.Width = tile.Animation.CollisionSheet.Width
|
||||
render.CollisionAnimate.Height = tile.Animation.CollisionSheet.Height
|
||||
}
|
||||
|
||||
if tile.Animation.OnDestruction {
|
||||
render.DestructionAnimate.Sprites = tile.Animation.DestructionSheet.Sprites
|
||||
render.DestructionAnimate.Width = tile.Animation.DestructionSheet.Width
|
||||
render.DestructionAnimate.Height = tile.Animation.DestructionSheet.Height
|
||||
}
|
||||
|
||||
if tile.Animation.OnIdle {
|
||||
render.IdleAnimate.Sprites = tile.Animation.IdleSheet.Sprites
|
||||
render.IdleAnimate.Width = tile.Animation.IdleSheet.Width
|
||||
render.IdleAnimate.Height = tile.Animation.IdleSheet.Height
|
||||
render.StartAnimation(components.Idle)
|
||||
render.Hidden = true // we do NOT render the sprite, but the idle animation instead
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user