Day 83: Today I had to “leave” early to go grocery shopping, because there’s nothing left to eat. Oh and also because I need stuff to make the Christmas gifts. Speaking of which I freaking hate this period. Too much social pressure and useless traditions. At least food is nice. Pro tip if like me you hate spending time buying/finding presents: learn how to make chocolates. That way you can give the same thing to everyone. And it doesn’t looks cheap because you did it yourself. You can even take this further by giving the same thing every year, turning your laziness in a form of tradition. Only downside is it takes a lot of time. But at least it’s time inside your kitchen and not in overcrowded shops.
Daily interesting stuff:
Reddit post about thinking too much about code design. It was much about “code first, think later”. I partially disagree. It sure make sense to not worry about problems you might never encounter. But it can bite you in ass quickly. Plus if your goal is to improve, thinking about architecture is important.
Reddit post about experience of hiring freelance artists. I didn’t have time to read it but these kind of post are alway interesting.
Book about reaching the press. I didn’t bought it, but it seems like a solid investment.
Tasks done:
Implemented the pause menu. This was actually really straightforward. But that doesn’t mean it didn’t take a long time. UI and animations are easy but time consuming. Especially when you don’t have a clear design. In cases like that you have to try multiple stuff. And since the animations in Unity are in “absolute”, you have to change a lot of stuff each time. Opening the settings pane was a bit trickier. It’s the same panel than in the main menu (at least for now). So it was the same opening/closing code. And so I had to handle the fact that when the start button is pressed and the game is paused, the settings menu should be closed as well as the pause menu. I’m glad I finished it today, that leaves only the tutorial for the rest of the sprint. Hope I’ll have enough time to finish it tomorrow..
Replaced the deprecated Application.LoadLevel. I had those warnings for quite some time. So Since I had a bit of time left before calling it a day I decided to finally fixed this. It’s actually really easy I just have to replace them with SceneManager.LoadScene. I should’ve changed the loading and go for an async loading, but that will be for another time.
Refactored the InputMap UI. When I looked at where the loadLevel where, I had to open code that were “old”. So of course I found it ugly. It’s the remnant of the singleton based UI. I changed it so that’s it’s event based and has nothing to do with game logic. Well actually it does still load the level between the inter-game and the main game. I didn’t change this because I need to load only after the opening animation is done. I didn’t find a better solution.
Fixed a minor bug when you die the second time. There was an error where the weapon would try to destroy itself while it was already destroyed. At first it didn’t made any sense. How can the death function of something dead could be called? Well it’s easy, it’s just that I didn’t un-register the player death event. So the event dispatcher still had a reference to the listener’s delegate and thus the object wasn’t garbage collected. It took me no time at all to debug it, and I’m kind of proud of it.
0 comments