I believe that I had previously mentioned that once I had a gamepad working it would be a “Rockstar Moment,” and now that I’m looking at it, I’m let down. What I had thought should have taken me an hour or so, took me two last night and it still isn’t done yet. The issue, the biggest one anyway, is that all the control code was clearly done using only my giant monkey feet. It’s written poorly. It’s like, the first thing I wrote for this project so many moons ago. It’s not standardized, so the functions ask important questions like, “Are we pushing an arrow key?” then it goes ahead and makes the character run around. However, the Run() function then asks, “So what key are we pushing again?”
If I wrote it again today I would take a nice top down approach and ask the thing once what it’s doing and then just let other stuff know. As it is, every single little instance has to be modified and checked to ensure that it isn’t excluding anything or breaking something. Like there was a time where the character would only run if an arrow key was pressed and the stick on the XBox controller was pushed in the same direction. Now let’s go ahead and solve that same problem a few dozen times.
Oh, right, and all the menus need fixin‘ too. Plus testing.
Right, talking about testing, The Tester doesn’t own a wired XBox controller (considering that they aren’t even made anymore, reasonable), so I can’t strip out keyboard control. It needs to work with both inputs, and since I don’t want to have two different builds it needs to do so simultaneously.
It’s not all rage and hate though. Towards the end of the night, it started to work. I used a control pad and pushed the little buttons and used the little stick to make my little dude run about the screen. Sure it was broken, but my inner six year old cheered.