Next installment: a bit about loading libraries, modules, sub-modules and constants.
Ok, so you're probably roaring to go, and actualy do something that is actually related to game programing. Well, we're almost ready to start... but first, I have walk a last side-road for a while, sorry for that.

As you may have realised from looking at what puts 3.methods wrote on the screen, there is a huge amount of commands available to Ruby. So much, in fact, that probably no one would need all of them, and that the name of the command would have to become very long and perhaps confusing if all those commands were available directly. To prevent this mess, related commands (procedures, functions) are grouped together into neat packages called "modules" in programmer lingo.
A good example of modules is the Math module. It contains more advances math commands, like trigonometry, or the square root which is abbreviated to sqrt like this:
puts Math.sqrt(4)
-> will write 2.0 to the output.
"Math" is a module, an it contains several math related commands, like Math.cos Math.sin Math.tan Math.sqrt . So, what Math.now means to Ruby is, look into the Math module, for the sqrt command, and do what it must do. It's actually quite similar to
s = "Bob"
puts s.length
Where you put the text bob into s ,and then tell ruby that it has to look up the command/method length into the commands that are related to text strings, and hen do what it has to do for that string.
OK, but what if you get tired of always writing the name of the module in front of the command? Well, then you can do it like this:
include Math
puts sqrt(2)
the include command will take all commands that are in the Math module, and mke them direcly available, so you don't need to type the name of the module anymore.
Now, a bit about constants.
What's a constant? Well, it's much like a variable, that is , a named location where a value has been stored. However, different from a variable, you don' t want it to change. An example might be the value of PI, you know from the formula of the circle circumference is 2 times the radius of the circle times pi. Well, in Ruby, this value is in the Math module. Try this:
puts Math::PI
-> 3.14159265358979
The value of PI is something that's not supposed to change, so, that's why it's a constant. You use the :: in stead of a . to look up the value of PI in the math module, because PI is not a command, just a constant, and it would confuse Ruby if you mixed up the two of them. How does Ruby know that PI is supposed to be a constant and not a variable? Well, simple, it looks at the first letter, and if that's a capital letter, it treats the thing thus named like a constant.
Did you notice the name of the Math module is also a capital letter? Yes, it's a constant , because, you probably don't want to change the contents of that module (the functions that it contains).
One other problem with the huge amount of commands potentially available to Ruby is speed. The more commands that Ruby has to know about, the more time it has to spend looking them up, slowing down things. Just like a clerk in a big book shop will need more time to find a book than one working in a tiny book shop. So, that's why all of these commands have been split up into different parts, called "libraries". Almost all programing languages do split up their functionality over libraries, so you can make the program run on a "need to know" basis, which is good for speed and simplicity. Libraries also allow many different people to work on ading new commands to a programmin glanguage.
A good example of a library is of course the rubygame library, which contains a lot of commands needed for working with the screen ,audio, etc, for making games. Normally the commands in that librar are not available until you install that library, and also tell Ruby to use the library inside your program. You'll have to tell Ruby that you really want to also use the commands related to game programming in rubygame, in the "rubygame" library. You do that like this:
require 'rubygems'
require 'rubygame'
Rubygame.init
Rubygame.quit
This program does nothing but start up Rubygame and close it down again, but it should run without giving any errors if rubygame is installed correctly.
The require 'rubygame' command tells Ruby that you really need the Rubygame library, and makes it so that Ruby will look up commands in that library. The name of the library is between quotes, because names of libraries need to be text strings in ruby. You also need a require "rubygems" before that, because the Rubygame library itself needs some stuff that's inside a different library called "rubygems". Once the rubugame library has ben loaded, the Rubygame module that is inside the rubygame library, and all the commands it knows about became available for use.
Which means were're almost ready to start displaying something on the screen!

But perhaps it's better if I let you digest al the stuff I wrote above before I continue. I eagerly await your questions.
