Wave Announcement (Coding) – Week 4

This week, i am going to write about one of the latest additions to our game Selfish, which is the wave announcement.

One of the things written in our feedback, was that the enemy waves were spawning quite fast and without warning. With that in mind, we decided to make a wave announcement UI, that would pop into the screen right before the enemy wave appeared. While that was seemingfully simple, it turned out to become quite a headache. One of the things that would provide that aformentioned headache, was that i personally had not used a repeating function before. It took a while to actually understand how it works, but it was really going to be needed (now for this specific task and even more for any future tasks), since it needs to be working on repeat as well as have a certain delay on it. After consulting my teamates for the correct use of the previously mentioned function i was able to have some results. While that meant that progress was made, the results were not satisfactory, since the Announcement would linger on the first enemy wave, until you cleared it and the second wave would work normally, while the next ones would not. Apparently, part of the code written by me, would not work in the IEnumerator (which is the aformentioned repeating function).

After spending a bit too much time on it that week, i decided to drop the task as it was, just to be able to pull through with the rest of the tasks given to me. Result of that, was that i had to retake this task for the next week.

Luckily, this week we had our code reviewing with our teacher and i decided it would be a good chance to get another set of eyes on the code. Turns out, that all that needed to be changed for the announcement, was to send it to a gameObject. Basically, after adding one line of code to what had already been written, made it work properly. The only thing that was not resolved, was that on the first wave, the announcement would not go away after a the set time we had. It felt pretty silly to be told to add the function doing that to the starting function of the script, because the solution on that at least was pretty simple.

Well i did learn that i should probably get a fresh set of eyes, because a programmers worst enemy appears to be frustration.

eJwFwdENhCAMANBdGIDaEhBd5sIhQRK0hPa-zO3ue4_5zW52c6oO2QGOJpnnYUV5plpsZa69pNHEZr4gqaZ8XuVWAfKLWzCEGNCTj0gOKIbNb7Si8w6JIgb4dq6f0bIddzX_FycBIwM.png

UI Wave Counter and Pause Menu (Coding) – Week 3

One of the things on my plate for a while now, was the UI for displaying the number of waves in our game. While i had been trying to make it into a separate script (and getting other necessary variables from other scripts) i would always find a few errors that i could not get passed. Those errors would usually be that i could not make an integer become a string variable. While this is probably something that i need to learn, sooner rather than later, i was not able to figure it out. In the end i had to go into an already existing script, that contained most of the variables needed, and wrote the wave counter there. The only thing that i can keep from this experience, would be to be willing to ask for help (from the teachers or anyone for that matter), just so the time spent, doesnt become too much without yielding anything. Since i have done this, i have ended up not being able to provide much to the team, and even to myself. Wasted time and effort.

eJwNyUEOhCAMAMC_8ABairDE3xAkaKKU0Hoy_t2d6zzmnqdZza46ZAXYDik8NyvKM7dqG3M7ax6H2MIXZNVc9qt2FaCAHl2MKbpAITnyQGlZCFOK9A-PP49Q-O5apx29mfcDA40itA.png
Another thing i was tasked with, was the pause menu. For starters, we wanted something simple. As in every pause menu, you select a button and make it pause the game. In this case, since we are already using the most used button for that, which is the “Escape” button, we decided to use the button P. The pause menu would also contain a few buttons.

Resume : Resumes the game whenever it is clicked (also possible with the keyboard letter P)

Exit Game : Closes the game

paus.png

The ones stated above where the ones that have been used for now. The plan is to follow with an option that allows the player to lower or raise the volume, which i was not able to implement earlier, because we did not have any sound in the game yet. Another possible button to follow, would be to go to the main menu. The last two, have been suggestions and will probably be implemented next week.

To conclude, i believe that wasting too much time on something, as i have the last week or so, does not put you in the best position. You should always strive to keep going ahead, even if sometimes that brings you down. In short, makes sure you are good with the tasks you are given, and dont be too proud to get input on them, because that should in turn help you become better as well as make you not look like you are being lazy.

Ammo UI (Coding) – Week 2

Last week, i accepted the task of making the ammo UI for our game. While i thought the task would be relatively simple, i was proven wrong when i actually began the work on it. While the task seems simple enough, i also had to go through the code written by my fellow teamates, which required a significant amount of time. That time of course, was spent to understand the code already written and further on used for the aforementioned task. Like i already stated above, i expected the task to be rather simple. It was quite surprising to see, that even the smallest spec of code, can bring down so many errors, if it is not written correctly.

For example, one of the things i was struggling with, was the need to turn a given number (from part of the code written by the others in another script)to a part of the text (the amount of bullets the gun had left), which i had no idea how to do. The biggest problem that i encountered though, was the code needed to transfer a number from another script, to the one i was currently working on. The later problem, is also really important, because it will always be needed for this kind of work. After a few hours spent looking into this problem, i decided to ask my fellow teamates for some input. From what i had searched, i had a few ideas, which did not seem to work properly. So when i did consult with my teamates, i got some ideas from them. While it was not something concrete, it did give me a boost to get unstuck from my predicament.

In short, i was able to find the solution to the problem of taking a number from another script (what i had looked up in the internet, was apparently from older versions of Unity) and further on i was able to figure out a way to turn a number to text. While i felt like this could have been avoided, because the amount of writting needed for this was little, i learned that even something little like that, can become quite problematic. The good thing about this whole thing though, is that this lesson is gonna be staying with me. Including that practice makes perfect, or at least adequate.

ejwnznsnwyamambdgadzcntnmheiicafjldzvxx39ga4j3rwrxz1iuzeac7gmdapwwilwnqlqndjs7ho1cgjphz1motbbeonjrgjds6gdr4cwkt0b2nxczg-cinzzbefrf-3i9mzpcw9r1xfh_u_kdi

Shellfish – Group S – Map Boundaries (Coding)

Our team Shadhavar is making a game called Shellfish which is a 2D shoot’em up game, that takes place in a fishtank. One of the responsibilities i was tasked with, as part of the 2 man programming unit of our team, was to make a script of the levels map boundaries in Unity. Making the boundaries includes not letting the player nor the enemies to leave the level which is in 1 screen (meaning that the camera remains stationary and that the player cannot exit the screen).Another thing included in the map boundaries, was also to make sure that it would work in all kinds of different screen sizes, which means that the code used in the script should be flexible for any resolution the user desires. While coming up with the solution to this problem, i realized that the script should be recognizing the resolution that each player is using . Further on, it should save that resolution and use it appropriately to stop the characters from leaving the ingame screen. While the thought process was correct, i was not able to completely fullfill the task given to me, because the characters where able to partly leave the screen but never fully.

I tried changing a few things to patch up this problem, but was not able to find a solution to it. The problem was solved by my partner, who was able to identify the problem and fix it accordingly. The forementioned problem was that the characters did not have a box of their entire body, but rather a small part of them was recognized. In turn that means that the code, prevented the characters to go out partly because that part of them in the shape of a cube would be stopped (and that part did not cover the whole entirety of the character). The fix was to box them into the appropriate shape, and then write a bit more code, to make sure this box cannot leave the screen. While i was not able to complete this task alone, i do feel that the tracks were set for this script to be finished with a part of me in it.