If the carriages move or animate independently (say, the train turns a corner) then it would be easiest to have each a separate large enemy sprite slice, otherwise I would use a backdrop slice for everything (which also lets you use more than 16 colours, but this looks like a limited palette), with multiple backdrops for animation. Attaching the slice(s) to NPCs means you can use regular NPC commands you're familiar with rather than using slice commands, but it looks like this is just moving in a straight line and it would be useful to be able to use the "move slice by" or "set slice velocity" commands with varying speeds to make the train accelerate.
To use NPCs, use a modified version of the walktall "embiggen walkabout slice" script, something like this:
Code: Select all
# Called with two arguments: NPC id or reference, and large enemy sprite number
script, embiggen npc to large enemy, npc, spriteset id, begin
variable(sl, pic sl)
sl := get NPC slice(npc)
if(sl) then(
pic sl := lookup slice(sl:walkabout sprite component, sl)
replace large enemy sprite(pic sl, spriteset id)
)
end
To use non-NPC slices you would load and parent them to the appropriate map layer, like:
Code: Select all
global variable (1, train slice)
# in the map autorun script
train slice := load backdrop sprite(id)
set parent(train slice, lookup slice(sl:map layer3))
put slice(train slice, -40, 80) # set top left position of the slice on the map, in pixels