switched to go coded animation system, LDTK is not used for this anymore

This commit is contained in:
2024-04-08 18:51:25 +02:00
parent 2793710819
commit f23bdaf121
15 changed files with 233 additions and 240 deletions

View File

@@ -2,7 +2,6 @@ package game
import (
"image"
"log"
"log/slog"
"openquell/assets"
"openquell/components"
@@ -198,27 +197,6 @@ func LevelToSlice(game *Game, level *ldtkgo.Level, tilesize int) (Map, Map) {
}
tileRect := entity.TileRect
animationtrigger := util.GetPropertyString(entity, "AnimationTrigger")
slog.Debug("got trigger", "trigger", animationtrigger)
//animateondestruct := util.GetPropertyBool(entity, "AnimateOnDestruct")
// FIXME: also check for AnimationLoop and other animation reasons
// if animateondestruct {
if animationtrigger != "" {
tile.AnimateOnDestruct = true
animation := util.GetPropertyString(entity, "AnimateSpriteSheet")
if animation != "" {
if !util.Exists(assets.Animations, animation) {
log.Fatalf("entity %s refers to non existent animation set %s",
entity.Identifier, animation)
}
}
tile.AnimationSpriteSheet = assets.Animations[animation]
tile.AnimationTrigger = animationtrigger
}
tile.Sprite = tileset.SubImage(
image.Rect(tileRect.X, tileRect.Y,
tileRect.X+tileRect.W,