
I've successfully rebuilt the enemy "AI"! 🌞
First were the "projectiles" (the blue spinning icons), which needed to have a few settings: They can either patrol between two points, move around randomly, stay in place, or go off in one direction (North, Northeast, etc.).
The only issue so far is the checking of the target position. I'm currently just checking the distance between two vectors, and if the distance is very small, then it can patrol back (or whatever it needs to do on the target position, depending on its movement type). But for now it's alright.
Next were the "creators", these can create/shoot projectiles with specific settings in certain intervals. These needed an open/close animation, which was a bit tricky. The animation consists of very small PNGs (little "claws", as i called them), and they rotate in a way so that it looks like it's opening a sort of silo where the projectiles get created.
Here's what it would look like with only one "claw":
I put all the animations and spawn timings into a Coroutine, and it seems to work quite well! Â They can also spawn projectiles with a maximum limit, for example, only spawn one projectile at a time, and spawn a new one when the old one was destroyed. The "silo" also stays open until they can spawn more projectiles.
In addition to all that, the creators can also move around just like a projectile, which is needed in later levels. Thankfully this was pretty easy, barely an inconvenience. I just added the Projectile class to it, and It Just Workedâ„¢.
Next up I needed to create a cursor for the player to move around, mostly for controller. I made a quick one using an existing gradient sprite from Catty & Batty, and i used the player_movement script from Catty & Batty as well, which pretty much worked immediately. There is no cat or bat, so you're really moving around an invisible entity, but the cursor is enough information anyway, funnily enough. It works for now and i can refine it later.
For mouse, I will be able to just translate the cursor position 1:1, which wasn't possible in Catty & Batty due to the walls you could run into. But that's also for later.
I checked the size of the fields and adjusted all of them to fit in a 1x1 square in Unity measurements. It looks like i might need to zoom in the camera a little bit, but I will first try and recreate one of the levels to know more.
Next is the actual grid implementation, so that I can "turn fields". Will also have to find a better word for that, but we'll see!
To be continued... 💎