Week 4: Arkanoid

Hi,

So.. Week 4 of Game Programming. This week we started another game. We started to create Arkanoid!

Here we basically learned how to create readable software projects with a good code structure. We have also learned the value in it aswell. Even though code is just a bunch of symbols and random words for a lot of people, it is actually a language. Programming-languages are extremely powerful languages. So when you are programming you are responsible for the code you are writing. If you do not have a good code structure so it is readable for anyone, including you, how can you co-operate with another programmer?

So, I would almost say that this week have been the most important week so far. We once again used the teaching-technique called Live code, this means that our teacher is writing code and we are writing it in our computers and he’ll then explain what it means. We used the same technique when we created Pong, but it was almost unreadable. For this project even I can find errors in the code since it is much more human-friendly. I will show you pictures of this at the bottom of this post.

I think this is the most important week so far because this is teaching us to really be able to co-operate with other programmers and software developers. If we can’t do that we will not be able to have a future within this career. You may think that you can have a career if you are the only programmer and developer and you think that you’ll remember where you wrote that and such.
I am saying no to that. If you have a game or another kind of software-program with one million lines of code. If you wrote all of this in the main.cpp you will not be able to find anything. And without comments and header-files including classes, you will not be able to understand what you did at some point or why it is not working.

My tip, from a beginner programmer to you, is that always write the code as readable as you can!

arkanoidSolution

 

arkanoidClient

 

As you can see, in the picture at the top, we have multiple header files and equally many .cpp files. Each one have a relevant name so that everyone can understand what it does.

For example:

DrawManager, it is the class which draws out everything on the computer. Without I wouldn’t be able to show you how the game looks like, since it wouldn’t exist visually.

Until next time; Write readable projects with good code structure.

Cya later, Alex

About Alex Henningsson

2014  Programming