Hey guys, I've started a series of tutorials on game programming aimed at the complete beginner. So far, I have Part 0 done (took a long time to write!), and I will be working on the rest regularly. I'm trying to write the tutorials that I was looking for when I first ventured into the world of programming. The whole "learn by using" thing - I won't even touch classes until my second set of tutorials, since I didn't need them for my first few games.
So, if you want to learn game programming from the ground up, check out my series. You'll learn why classes are useful, by seeing what it's like without them =]
Comments and critiques would be great! =D
Check it out - http://codingb.blogspot.com/
Game Programming Tutorial series
Game Programming Tutorial series
Last edited by Buck1000 on Sat Sep 10, 2011 7:53 am, edited 1 time in total.
Re: Game Programming Tutorial series
Applaud your effort. Beginners will likely wonder why the variable example snippet won't compile:
Code: Select all
int a = "4"; //Let's assign a value to a
int b = "772456"; //And to b
int c = a + b; //You can assign a variable the result of an operation, the return value of a function, and more
float d = a / b; //Since a/b in this case is not an integer, we need a float
cout<<"a / b = "<<d; //Display it! =D
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
Re: Game Programming Tutorial series
Yeah, you`ll better remove those quotation marks. Plus the line float d = a / b; looks a bit ugly and will throw a warning. You can also change it to multiplication and keep the type (int m = a * b;), work with floats or avoid this type of 'casting' etc. And for the tutorial you need to keep things simple, so you`ll better change the a to 10 and b to say 2. This way the reader could easily guess the result and compare it with the one, generated by the code and convince himself the computer can calculate such a thing correctly.
Looking forward for the next tutorial.
Looking forward for the next tutorial.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Re: Game Programming Tutorial series
Code: Select all
float d = a/b;
Code: Select all
float d = (float) a/b;
Re: Game Programming Tutorial series
Applaud your effort. Beginners will likely wonder why the variable example snippet won't compile:
Thanks for catching that, I didn't notice the quotation marks. Fixed =]Yeah, you`ll better remove those quotation marks.
Plus the line float d = a / b; looks a bit ugly and will throw a warning. You can also change it to multiplication and keep the type (int m = a * b;)
I didn't know operations had to be cast as well - the line doesn't throw a warning (at least not when compiling with "g++ test.cpp -o test"), but it does churn out an integer. Thanks for letting me know. I'll change it to an example of multiplication, and make a separate set of operations involving floats (and make the numbers smaller and rounder ). Casting is too complicated of a thing to teach in Part 0.serves no useful function. "a/b" *is* an integer. If you want to invoke the promotion rules you need something like ...
I'll go ahead and get started then =] It won't be done for at least a day though. I really underestimated how much there was to write in the first one when I got started. But, it's fun in its own way.Looking forward for the next tutorial.
Gah, there's a mistake in my first post. *fixed
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Game Programming Tutorial series
Always compile with -Wall under gcc/g++, then you will easily catch these errors.