I haven't really been able to spend a lot of time on the game since I'm in the middle of moving. I was able to get a little bit done tonight though.
I changed from a list of function parameters in the screen manager's changeScene() function to an object that holds all of the desired properties. The first issue, of course, was one of defaults. With parameters, giving a default value is easy, but the downside to them is that if you want to define the last one on the list, then you need to provide some sort of value for all of them, even if you don't want to change the default values. What I ended up doing was creating a "defaults" object and added a mergeObject() function to my Utility class. Then I took the parameter (which may be null altogether) and merged the defaults in. The parameter's properties take precedence. So, I'm good to go. After a little bit of testing, I think I can go to bed now. I'm just glad to be making any sort of forward progress on a regular basis, even if it's tiny.
No comments:
Post a Comment