UI Elements


I implemented a title screen and an end screen. The title screen is shown on launch and the end screen is shown when the game is beaten. In the title screen I made a text object to display the title. I also made a text object in the end screen to display a message. I made sure you could access the title screen from the end screen. I also made an attempts counter using yet another text object. I wanted my attempts counter to add 1 every time the player died. I had some problems with this. First my text was not displayed properly. This meant the text would dissappear if I made the font size too big. It turned out I just needed to make the box for the text bigger. After this issue was fixed my attempt counter was working well. Only problem was it would give a null reference exception error. This would crash the game if running on the itch.io site. It turned out the problem was I had misunderstood what my script was trying to do. I had put my script on my exit sign object. This was an issue because my exit sign did not have a text component on it. In other words I was trying to reference a component that did not exist. Due to this when I built my game and put it on itch.io it would crash when my player touched the exit sign. I fixed the issue simply by removing the script from my  exit sign.

Files

UI elements (2).zip Play in browser
Oct 01, 2020

Leave a comment

Log in with itch.io to leave a comment.