In-Depth Blog Post #5

Where am I now?

I am halfway finished the “demo” of the game. For the demo that I am planning to release, only 2 chapters of the game will be playable, with a sneak peek into the 3rd chapter. At the end of the 2nd chapter, there will be a time-skip 13 years later in the future, where the rest of the game will take place. I am currently developing the battle portion of the game, similar to the last blog post. In terms of increase of code lines, I have not added many lines to the program from last week.

As of the time of writing this blog post, I have 1295 lines of code, meaning I have only added 58 lines of code to my game. However, these lines have been added into the battle function of the game, meaning they will be reused later in the game. I will talk more about functions in my Beautiful Mind segment of the blog post.

How did I meet with my mentor? What happened?

Alike the previous blog posts, I had met with my mentor over the weekend. I had again shown him my program and how far I’ve made it, and I have also told him about my change of plans for the entire project. He seemed a bit disappointed in the news, but also understanding, and was happy that I promised to keep working on it as a passion project myself. After playing through the game as I had done it at the time, he had said that there was no issue or any detail that he could point out that would change the course of the game. He was, however, very interested in the battle sequence that I had designed. Below, you can see a small snippet of the battle sequence of the game:

Here, the program prints the enemy’s health, as well as the user’s. Then, it asks what the user would like to do, with 3 options: Attack, defend, and to check their bag. In this snippet, I chose to check my bag, and in my bag are some items that were given to me by my supposed “mother” in the game. However, I asked my mentor a question about me reusing the battle sequence later in the game, which I will cover more in the Beautiful Mind segment of the blog post.

Proof that I am making progress?

Find the screenshot below to see a few lines of code, as well as the total amount of lines in my program on the bottom right.

What are some issues that I’m running into?

I’m not running into many technical nor mental issues with the development of my game, so I am feeling very confident about my ability to deliver a polished product by the end of my timeline.

What sources am I using for my education?

My sources have remained the same: Programiz, w3schools, Real Python, DataCamp, and YouTube (I will mention that I’m starting to leave w3schools as a source of info). While it may seem as if I am not using many sources for my education, and you wouldn’t be far in assuming that, these sources are actually all the sources I need as there is a lot of information on computer programming online, especially for the language I am currently working with, Python. Python is one of the more popular language, and since it is so beginner friendly, there are many sites with useful information about the language on the internet, but I’ve settled with these since I find that these websites contain all the information I need.

Beautiful Mind: The Six Hats

As I have mentioned before in this blog post, my meeting with my mentor has remained much the same as my previous meetings, apart from the moment where I asked a question about the battle sequence of my video game. In my game, I would like for there to be moments where someone talks during a battle, or a battle ends early because a character should not die at that moment. If I wanted to alter the form of a battle, what should I do?

In computing, there is something called a function where, similar to math, when given a variable as a parameter, the function outputs an output. The battle sequence I have taken a screenshot of before in this blog post was from the function in action. Functions can be repeated as many times as you would like in your program, which is why I made a function for the battle sequence of the game. If a game revolves around battles, it would make sense for you to create a function and simple call the function again and again.

For example, let’s say we have a function called “coolfunction.” We could give the function a string (basically a line of text) as a parameter, and make the function print that out. Of course, this specific function would be useless, but this is only an example. We would code:

def coolfunction(x):

The ‘def’ part of the function is to create and define the function by that name. If we wanted to make this function print “Hello world!”, we would later input:

coolfunction(“Hello world!”)

The point is, I would code the entirety of the battle sequence in a function so it can be called time and time again. However, what if I wanted to alter the function in a specific case? I could only think of 2 options: To copy and paste the code of the function where I wanted it to be and alter it in that case, or to not have any special cases like this at all. Of course, the second option would not be a very good idea, as I would not learn anything, but the first option also didn’t seem intuitive at all.

This is what I asked my mentor. What should I do? Then, he had come up with somewhat of a middle ground.

Why not just add another parameter into your function, and change the code based on that parameter? For example, if the battle that the user is currently in is just a simple battle, put 1 as that parameter. If you wanted a character to say a specific line at a specific point, put 2, and etc.

When he had mentioned this, his idea had struck me like a truck. When I understood what he was saying, I instantly began to think about how I could implement it in my mind. We then went on to talk more about the concept.

The topic of today’s Beautiful Mind segment is The Six Hats, and I’ll explain what these hats are and where I found them in our meeting.

  • White hat (facts and information): I was wearing my white hat when I thought with my mentor as to how to fix this problem based on what I knew about functions.
  • Black hat (critical thinking and judgment): I was wearing my black hat when thinking along with my mentor as to how I could implement an extra parameter into my program.
  • Red hat (emotions and intuition): I was wearing my red hat when I felt that it was a poor idea to copy and paste the code into the segments where I needed it and simply alter it.
  • Yellow hat (insight): I was wearing my yellow hat when I was thinking about the benefits and pros of the method that me and my mentor had come up with.
  • Green hat (creativity): I was wearing my green hat when I was working on coming up with a solution to this problem, and as to how I could implement it into my program.
  • Blue hat (organization of the other hats): The perfect hat to end on! For this blog post, I was wearing my blue hat when, of course, doing this segment of the blog post!

During my meeting with my mentor, I found myself thinking in all different types of ways, whether it be logically, with intuition, critically, or more. Not only is it important to get work done when you and others get together to work, but also to reflect on how you worked to only improve on yourself and how you think.