Next week I have exams, so this week is boring, with very little game development going on. As I have to spend a lot of time studying, I have only a little bit of time to read about C++, but not implement anything.
Tomorrow though, I will discuss prototyping functions, which is something I just recently learned.
Thank you for continuing to follow and comment on this blog. Once the next two weeks are over, I'll be on summer vacation and in game development overdrive :)
Adventures in Game Development -- 19
Hey guys, unfortunately I don't have a great update for today. Instead, I have a pretty boring update.
Today was spent learning more C++. I have pretty much mastered all of the C parts of C++. For most that probably sounds stupid, so I'll explain it.
C++ is a language that sort of has two sections. The first section -- the C part -- is the procedural aspect of the C++. This is pretty much all of the stuff I've covered so far in this blog. The second section of C++ is object oriented. I don't know much about object oriented programming -- yet -- so I'll just tell you that this portion of C++ allows for jumping around the program.
Considering C++ was originally called C with Classes, object oriented programming is a very important part of C++ and something that I need to start learning right away.
Today was spent learning more C++. I have pretty much mastered all of the C parts of C++. For most that probably sounds stupid, so I'll explain it.
C++ is a language that sort of has two sections. The first section -- the C part -- is the procedural aspect of the C++. This is pretty much all of the stuff I've covered so far in this blog. The second section of C++ is object oriented. I don't know much about object oriented programming -- yet -- so I'll just tell you that this portion of C++ allows for jumping around the program.
Considering C++ was originally called C with Classes, object oriented programming is a very important part of C++ and something that I need to start learning right away.
Adventures in Game Development -- Day 18
Today I took me first steps in learning Python. I didn't know much about the language before stepping in, other than it was easier than C++. Now, after having learned some of the language, I can safely say that it is much easier.
Here are some examples of how Python is easier than C++:
To declare any variable in C++, you have to precede the variable name with a type, like
Int variablename;
Or
Char variablename;
But in Python, you don't need to give a type, the language figures that out itself. So for example, this is how you declare a variable in Python
Variablename = 10
As you can see from above, Python also doesn't need anything to represent ending a line. So while you type a semi-colon is C++ to end the line, you type nothing and just move onto the next line in Python.
Outputting to the console is also much easier in Python. Here's some basic output in C++
Int variablename = 10;
cout << "The variable name equals " << variablename << endl;
The same in Python is
variablename = 10
print "The variable name equals", variablename
Finally, if/elseif/else statements are also easier in Python. An if/else statement in C++ is written like this
if(variablename > typename)
cout << "variablename is greater than typename << endl;
else
cout << "variable name is not greater than typename << endl;
The same exact statement in Python is
if variablename > typename:
print "variablename is greater than typename
else:
print "variable name is not greater than typename
This is why I really like Python. While it may be slower than C++ and other programming languages in execution, its very English-like syntax makes it quite easy to write.
Here are some examples of how Python is easier than C++:
To declare any variable in C++, you have to precede the variable name with a type, like
Int variablename;
Or
Char variablename;
But in Python, you don't need to give a type, the language figures that out itself. So for example, this is how you declare a variable in Python
Variablename = 10
As you can see from above, Python also doesn't need anything to represent ending a line. So while you type a semi-colon is C++ to end the line, you type nothing and just move onto the next line in Python.
Outputting to the console is also much easier in Python. Here's some basic output in C++
Int variablename = 10;
cout << "The variable name equals " << variablename << endl;
The same in Python is
variablename = 10
print "The variable name equals", variablename
Finally, if/elseif/else statements are also easier in Python. An if/else statement in C++ is written like this
if(variablename > typename)
cout << "variablename is greater than typename << endl;
else
cout << "variable name is not greater than typename << endl;
The same exact statement in Python is
if variablename > typename:
print "variablename is greater than typename
else:
print "variable name is not greater than typename
This is why I really like Python. While it may be slower than C++ and other programming languages in execution, its very English-like syntax makes it quite easy to write.
Follow My Other Blogs
While I always enjoy blogging about my experiences learning to program, I also enjoy blogging about other things. Because of this, I have started two other blogs.
You can click the links below to follow my other blogs:
http://gamesonmyiphone.blogspot.com/
http://casuallyanime.blogspot.com/
Thank you in advance for supporting my other blogging endeavors.
You can click the links below to follow my other blogs:
http://gamesonmyiphone.blogspot.com/
http://casuallyanime.blogspot.com/
Thank you in advance for supporting my other blogging endeavors.
Adventures in Game Development -- Day 17
Today I embarked on learning some of the Python programming language. Python is a scripting language which makes it great for implementing into C++. Because of this, I feel that it is good to know while I'm finishing up learning C++
So far Python has been quite easy. Python aims to be more like English than C++, which makes learning it fast quite easy.
I hope to learn Python quickly and mabey pickup Pygame (an off-shoot of SDL for Python) before I beging writing a game with regular SDL and C++.
Adventures in Game Development -- Day 16
After making my WEP cracking game more efficient, I decided to take a little break from it by working with SDL. For those who don't remember, SDL is the graphics API for C++ that will allow me to make graphical games. Unfortunately, there is quite a learning curve for SDL.
So far, I've had lots of trouble trying to learn SDL. My biggest problem is that there aren't many good tutorials that guide you through all of the SDL functions. I can learn the syntax of C++ and the syntax of SDL, but I'm having trouble gluing them together.
The tutorials I've used so far have been unsuccessful. However, I found a tutorial website that looks to be better than what I've found so far. For the next week or so, I'll be covering one tutorial from the SDL portion of the site per day.
Here's a link to the site for anyone who wants to check it out: http://sol.gfxile.net/gp/ch01_devcpp.html
So far, I've had lots of trouble trying to learn SDL. My biggest problem is that there aren't many good tutorials that guide you through all of the SDL functions. I can learn the syntax of C++ and the syntax of SDL, but I'm having trouble gluing them together.
The tutorials I've used so far have been unsuccessful. However, I found a tutorial website that looks to be better than what I've found so far. For the next week or so, I'll be covering one tutorial from the SDL portion of the site per day.
Here's a link to the site for anyone who wants to check it out: http://sol.gfxile.net/gp/ch01_devcpp.html
Adventures in Game Development -- Day 15
Today was all about the for loop. In my previous code examples I showed how I was simulating a download progress bar in the command prompt, but it wasn't very efficient. This has been solved with the use of the for loop. Here's the new code using the for loop:
Once compiled and run, this loop displays the numbers 1 through 100, with a two millisecond delay in between.
Basically, this loop is given three commands. The first command tells it that the integer "begin" is being used. The second command tells it to display what is inside the loop while it is less than or equal to 100. The final statement tells the program to increment each time the loop is passed. Inside the loop, the integer "begin" is displayed, and the compiler sleeps for two milliseconds in between each display.cout << "Beginning download" << endl;int begin = 1;for(begin; begin <=100; begin++){cout << begin << endl;Sleep(200);}
Once compiled and run, this loop displays the numbers 1 through 100, with a two millisecond delay in between.
Subscribe to:
Posts (Atom)