So far this semester and technically for 2017, I have only had one game focused on for this blog. After a lot of work I am happy to discuss my other project. Right now a few of us are working on a small game targeted toward a younger audience. The idea is that the players will pick a fox or dragon at the start and begin their journey to save, rule, or ruin a kingdom. Choices have consequences and puzzles will pop up throughout as missions to give the player more involvement.
This game is one we discussed the previous semester and the idea of working together even earlier in efforts to have a nice game we’re proud of. Right now the idea is simple, a puzzle where the dragon will fend off enemies in order to keep others safe. The code behind it all is rather simple, first was the enemy.
Starting the enemies
So I have worked in Unity before, but the last time I had a few people around me who knew enough to help when I got stuck so I revisited it for this 2D adventure. Now the enemies were a little troubling to start since I hadn’t worked on AI to seek in quite a while. following the idea that the player would be stationary and the enemies would be coming it started out with a simple move to, or rather move towards. It worked and was enough I could test, but after a while I realized that this wasn’t enough. I needed to have the result of reaching the player and the enemy destroying itself when it happens for a fair attempt.
After these realizations my update went from one single line to enough to reach what we need.
After that I moved on, but now with this puzzle or mini-game just about finished I realized one more aspect could improve this. Making each enemy a random color. This would keep the player in a clear mind that they were an enemy while waiting on the art and give some more variance to what a player sees each time an enemy appears.
The only real struggle here was remembering the random for Unity colors was between 0 and 1.
So the last time I used Unity we moved away from spawners since I had some issue with the logic of Unity spawning items. After the experience in Unreal and some more general knowledge the whole plan went by much faster. The spawner didn’t take much time and I was able to add in loading from a file. That part has been trickier just due to it not loading properly, but I have finally gotten it to a way it works well and will soon automate better than a switch for however many puzzles we have in one full game. The enemies spawn with a speed in a random range and this is going to be used to add even more to the puzzle experience.
The player was by far the simplest thing although most likely the least efficient right now. I have thought of ways to improve efficency and will be implementing them as soon as time allows. Right now it locates any enemy on screen and will test how far they are. The time is minimal now, but more enemies means more time means this will be fixed at some point soon.
We have a lot of plans for this game and hope to maybe even market it. The next step is the second puzzle type for the dragon and then starting on the fox options. For now This is what we have but it is running and we can officially demo it like we need to tomorrow.