Multi-tile Player with frame animations

I'm struggling with a seemingly simple task.

I have a multi-tile player character (single player tile for the 'head', 5 other sprite tiles for the 'body'). I'd like to coordinate movement, but some of the body tiles have multi-frame animations that need to be synchronized to the player input commands (fps = 0).

I tried using the basic instruction provided here (Pulp how-to: two-tile-tall player) to move the non-canonical tiles in concert with the main player tile, but I'm then unable to execute animation commands using the 'frame' function on my non-canonical tiles (presumably because they're drawn as a new instance each frame - no way to track current frame 'state' in memory...?).

I next tried to use the 'mimic' function to have the non-canonical tiles just copy the player tile movement, but mimic does not appear to work when the target tile is a player tile.

I'm trying to avoid a lot of complicated swap logic, but that's starting to appear unavoidable.

Any ideas?

There’s currently no way to draw a specific frame of a tile animation. For now you could split the tile frames into separate tiles in the editor (by duping your current tile by its number of frames and deleting all but one frame from each) and draw those. If you include the frame number in the tile name you could do something like draw “animation name {frameNumber}” at x,y

appreciate the responses.

Since draw creates a unique tile instance each time it's called, I'm trying an alternate approach of using

tell [x,y] to frame [frame index] end

This is nested inside of an "animate" event on the player script that is called from the main game.loop function...but it appears to be doing nothing. Is there a way to increment through tile frames after the instance is drawn?

Drawing doesn’t create anything. It’s just copying pixels from a tile to the screen, there’s no instance of a tile associated with it (if a tile is animated it uses the global animation time that all instances of that tile use). A tile with FPS set to 0 will always draw the first frame.

Got it - appreciate the clarification @shaun.

1 Like