My entity's animation is 32 frames long. The shadow animation is only 1 frame. I get an error on startup because I'm not allowed to have different animation counts (32 vs. 1) in different layers.
I think an exception to this rule should be made: animations with 1 frame only should be allowed to coexist with animations that have many frames. My thinking behind this is that if there is only 1 frame, it's easier to select which frame to draw every tick (because there is only 1 choice) and therefore shouldn't hurt performance.
For reference, here is my code:
Code: Select all
animation =
{
layers =
{
{
filename = "file-path/entity-animation.png",
priority = "high",
width = 96,
height = 96,
frame_count = 32,
line_length = 8,
shift = util.by_pixel( 0, 4 ),
hr_version =
{
filename = "file-path/hr-entity-animation.png",
priority = "high",
width = 192,
height = 192,
frame_count = 32,
line_length = 8,
shift = util.by_pixel( 0, 4 ),
scale = 0.5
}
},
{
filename = "file-path/entity-shadow.png",
priority = "high",
width = 96,
height = 96,
frame_count = 1,
draw_as_shadow = true,
shift = util.by_pixel( 12, 5 ),
hr_version =
{
filename = "file-path/hr-entity-shadow.png",
priority = "high",
width = 192,
height = 192,
frame_count = 1,
draw_as_shadow = true,
shift = util.by_pixel( 12, 4.75 ),
scale = 0.5
}
},
}
},