Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what this does
Object critters that create body sections on spawn, that are pulled behind them. Could be used for giant snakes and such. Very rough draft.
clowntipede.webm
problems (goals)
The visuals could use some work. Sprites would have to essentially take up the entire 32x32 space to look somewhat right, which makes the critters massive. The code used to make the cord in Phonecord but fixed #185 might be able to be used to "link" the parts together? But I don't know how expensive it is to have every piece link to each other
If there was a way to force the head (and parts?) to only move in cardinal directions the visuals would end up less glitchy but I'm not sure how to do that.
If any part of the critter that isn't the head gets moved (someone pulling/pushing it), everything "above" that part will not move with it. This breaks the critter apart until the head pathfinds or gets pulled/pushed. This is also a problem with cargo tugs, which the code is based on. This is linked to problem no. 4
The critter can pathfind onto its own parts, which can look messy. You can fix this and problem 3 by making the parts be density 1 and anchored, but then the critter will easily get stuck in small spaces which are pretty common.
I add a reference to the head for all the body parts because I want to eventually have two types of linked critters. One where attacking the critter body sections will affect the head's health and kill the whole thing when the head dies. The second type would be giving each section individual health and splitting a new critter from the severed section if there's enough pieces (think the Terraria worm boss)
My code kinda sucks, there could probably be better variable names in there. I'm also not sure how to make the code able to be used for new types, since it seems you have to directly reference specific object types in the variables for it to work.