This week was spent working on the boss again. I was tasked with setting up the boss tentacles and attacks. The tentacles can now move in patterns set up in the editor with a script, and the whole tentacle will follow that pattern. They look pretty good, and make for decent attacks on players below the boss. They can’t do much to players to the side or above, but that is what other attacks will be for. The only things left to do for the boss are add in the last few types of attacks and add movement. Then it will be ready to be tested, and improvements can be made.
The way I planned on moving the tentacles was by connecting segments together with joints, then moving the tip of the tentacle through code. The other pieces would follow, connecting all way back to the source, giving it the look of the boss swiping its tentacles at you. I ran into some problems with the range and the way the pieces moved, so I tried out two types of joints. Neither looked great, so I tried moving the pieces with code too. After I added that, I tried each combination to see which looked the best, and it ended up looking best with both joints and the extra code. That’s what it uses now.
More specifically, each segment of the tentacles has a hinge joint and a fixed joint connecting itself to the next piece in the chain. The extra code pushes each piece towards the point it would be in if each link in the chain was evenly spaced between the two end points. Before adding in this last piece, the movement had trouble with pieces moving unevenly, with the pieces near the tip doing all of the moving, and the rest mostly just staying still. This code makes all of the pieces move at least a bit, making it look much better. There was also a problem when the tip would move towards previous parts of the chain, and the movement would get ugly. The code helps keep the other pieces out of the way, and keeps them in order.