Orbiting Fishies
|
So last post I talked about the big fishy, so in this post I’m gonna cover the smaller, but just as important fishy, I think it’s been dubbed cave fish(y). Since I’m the programmer I won’t be talking so much about the look, but more about the movement and “AI”. Smashing!An Early choice I made was to have the fish very interactable and leave the door open for more gameplay dynamics, so I wanted the cave fish to be fully physics based (told you I was gonna talk more about this). The fish has a rigidbody2D and a collider, using these for the first iteration I gave the fish the player subbo position and applied force in the direction of the subbo if it was within a certain range. Into orbitA weird “bug” that came out of this was that since the fish didn’t have any drag, and they were just getting force applied towards the subbo, this kinda sent them into orbit around the subbo. Although this is pretty fun to watch, it is not exactly what I was going for. ![]() I was also ignoring rotation at this point, so they were spinning wildly while orbiting. Fixing the orbiting was pretty easy, just giving the fishies some linear drag on the rigidbody stopped them from overshooting that much, and prevented them from flying into orbit.
You spin me round!The rotation was a bit harder to do, but I got help from fellow programmer Hamtaro. This has spawned a fun problem though, if you pass the fish they end up rotating round and swim on their back. For now I’ll just keep it like this, and at a later state I’ll try and implement a flip animation. Since I’m also using physics for my projectiles, when they hit the fish, they actually spin and fly off, which is a nice effect thanks to using physics. So my fish have a tiny death timer which makes them fly off a little before going *poof*. Last ThoughtsI like where the fishies are heading, but I definitely want to give them some more love. But this will do for alpha, I’m more for quantity then quality right now until all the stuff we need is in there, then I can give it some more polish.
|

