Programming / Math

I see now that I haven’t blogged for a while. Reason for that is that I didn’t feel like I had anything to blog about. Still really don’t have anything to blog about except that we’ve started with c++ and math, and will have that for the next 9 weeks. At the first glance the math that we have now doesn’t look that terrifying, I thought that once you got to the calculating trigonometry that it would be difficult, I remember that I had problems with that before, although I’ve created my own way of remembering which is which and how to calculate it.

Turns out it wasn’t so big of a deal after all, I’m not saying that I got everything right on the first attempt, but at least I understand the principles behind it. I’m not going to bore anyone with the details, but it’s interesting to know why we’re working with 1 to 0 and to -1 as numbers. I didn’t know that before, yeah I know it’s not _the_ revelation in the world, but nonetheless, it’s new to me. When the teacher went through it was all so obvious, almost so obvious that I should have figured that out myself. Anyway, I didn’t and now I know, but that’s the reason why we are learn this, because it’s something that we probably didn’t know on beforehand.

Programming

Today we also had our first lecture in advanced c++, what’s kinda nice to know is that we’ve already touched a lot of what is considered advanced c++. Inheritance, dynamic memory allocation etc. One thing we did see today, however I didn’t really feel that I got the grasp of was the Friend class type, which I want to do some research on, from what I understood you just put two classes as a friend to each other and you merge them in a way. That said it would be nice to see some examples of that, but now that I know they exist I can always just Google it.

Another new thing that we had today was the method pointers, now this is fairly abstract and we didn’t really get any good examples of how to use it and when, but from what I understood, it is a way to call on an array of classes that all have the same method and have them create themselves so to speak. Instead of using enumerations and having an enumeration that tells what kind of object you’re dealing with. For instance if you create a class called GameObject, you can create a child class called Player, Enemy, Stone, Tracks, Bullets etc. All kinds of children to that GameObject class, and in that class you create an enumeration that is called the same as the different types of classes. So when you create or instantiate the class you say that this is a Player, this is an Enemy etc.

If I have understood the method pointer correctly, you can instead create an array of those classes and run a method that is called Create(), and you create those objects and you have a pointer to that object. That said however I’m still not sure how you would practically apply it or use it. We will however get a demonstration of how it works tomorrow as the teacher wanted to come back to the subject. Apparently it’s not something that is widely used, but it is something that is good to know how to use. In addition to that, when we encounter code like that it is good to know what it does and how it functions.

Other than that most of today was more or less repetition of what we have previously learned, but tomorrow we’re going to learn more and hopefully be able to learn more about method pointers.

This weekend we’re also going to go through the idea for the big game project, and we’re going to send that in on during the weekend. It’s not my idea though, but the more I hear about it the more I’m thinking it could be something of commercial value later on, but we’ll see, the goal isn’t to make a game that you can sell, it is to make a game that is entertaining, fun and a little bit outside of the normal box.