Week 5/12 Not as quiet as it seems....

Hi guys, I'm back again with another rip roaring adventure throughout the trimester.

This week, I've been working more on the ratman project and it's been rather interesting.

So I've made the game manager to store the player lives and share variables to the UI so they are easily accessible, that was easy.

Next I went ahead and made some enemies to create a challenge for the player. For their AI to work properly, I've made 1x1 area hallways and made each enemy have an agent radius of about 0.5 units so they can move around easily. I used the Unity Navigation system to accomplish this, and it was relatively easy to do, as I've done this kind of stuff before. The trouble was laying out the level tiles in a way that would make it easy for the player to navigate too.

Now here is where it gets tricky. I know I couldn't use the navigation system for the player because the player gets input from the controller, and this is how it moves around the screen. I had to make my own system. Previously, before I started studying at SAE, I managed to make a pacman clone, more or less, and I had the same trouble with navigation of the player. I devised a system of triggers at each intersection and end of the maze to tell the player which way to go, but I was never able to make it work.

Now I am working on the same system, only now I have 3 years of programming experience behind me, instead of 2. This time, I'm making box colliders that are set as triggers and placing them at each intersection with a script attached to each object. When the player collides with each trigger for the first time, it will get that script and read a set of boolean variables that are set in which direction the player can go. There are four possible directions, so if we want the player to only be able to move left, we would check the left variable and leave the rest false. The player script reads this, and when the player presses a direction that they can't move in, it won't allow movement in that direction, well at least that's how it works on paper. I had to get some help from my lecturer in the end because I couldn't figure out a lot of the logic involved for actually implementing this and he helped me out a lot.

So. That's this week in a nutshell. Make sure you tune in next week as I'm sure things will get pretty busy in the final week.

Leave a comment

Log in with itch.io to leave a comment.