Thursday, November 5, 2015

An addendum to My First "Game"

I received a comment on my last post from Edhika stating that there was no way to restart the game. What kind of game makes you close and reopen in order to restart and go back to the beginning? Not a very user friendly game. Now, I could have said, that is what the instructions told me to do.

I decided to take the challenge and try to make it so the game "reset" after the game was over. Actually, I took it a step further and made it so you can restart the game at any time. I am not sure why you would want to start over in the middle, maybe it is getting to fast, or you didn't like how you were doing on that "level." At any rate, you can now start over at any point in the game.

It wasn't as difficult as I thought it was going to be. I ended up adding a message box to give you some stats and how to restart the game. I added an if statement that checks if the key pressed is Enter. Once that key is pressed I put a new function called startOver in my Stats class. The function resets the data, difficulty, and restarts the timer at 0.

Pretty simple, right? It didn't take me very long to figure out what I needed to do, but it got me thinking about another aspect of coding which I have not been involved in much. That is the design sessions to determine what needs to go into a program.

The book gave you directions on how to get a very simple game. I can understand that adding the function to restart the game would have been a couple more pages of code and writing and maybe it didn't fit in at this point in the book. At the same time, I didn't do anything new in order to reset the game. Everything I used and put in addition had been written about in the prior changes. The book really likes to use message boxes so creating one is ingrained in my head.

If this were a software company designing the typing game it never would have been shipped. There would have been meetings with all the smart people that are involved in the creation of the end product. Maybe one person didn't think about adding a "reset button" but another would have thought about it.

I have only been involved in one design meeting at work. I have said that I fix bugs at work, which I do the most of, but this was one of my first new features I added. It was a fun meeting and we came out with a great new feature, a button that reruns SSIS jobs. Well, my enhancement lasted about four weeks before another and more experienced coder ripped out the rerun guts and made it better. I know there was another design discussion because the changes were very significant.

Short story, a nice comment on my last post made me realize how important design discussions are and how they are needed. I know my "game" still isn't perfect, but that is why all software has new versions come out. Here is version 2 of the typing game. There are still the same limitations that I shared in the last post.

I also made the game too easy if K.C. can get 100% on 80 keystrokes! Maybe the next version will be more challenging for you.

No comments: