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.

Leave a comment