Forums Archived

The forums are being archived. See this topic for more information.

Basic rubygame help

Get help and support with Rubygame

Basic rubygame help

Postby blittergames » Thu May 21, 2009 3:15 am

I have some pygame applications I made that I want to make with rubygame. I read 1-4 pages of Kibas rubygame book but some parts I didnt understand, but a lot I did get thru and it worked.

http://wiki.kibabase.com/The_Rubygame_Book_Part_1

1. Whats the point of having a setup file, controller file and the game file? Is this to be more organized? Reminds me of MVC. Anyways whats the significance of this.

2. Why do you have to have 2 things requiring/including rubygame? Why would one suffice? Require is for running rubygame and the include is to load the rubygame lib into that file?
Code: Select all
  require "rubygame"
  include Rubygame


3. What does the "::" mean? Whats this called in ruby?
Code: Select all
@queue = Rubygame::EventQueue.new()
blittergames
 
Posts: 4
Joined: Thu May 21, 2009 2:52 am

Re: Basic rubygame help

Postby kiba » Thu May 21, 2009 4:53 pm

blittergames wrote:I have some pygame applications I made that I want to make with rubygame. I read 1-4 pages of Kibas rubygame book but some parts I didnt understand, but a lot I did get thru and it worked.

http://wiki.kibabase.com/The_Rubygame_Book_Part_1

1. Whats the point of having a setup file, controller file and the game file? Is this to be more organized? Reminds me of MVC. Anyways whats the significance of this.


There is nothing improtant in how it is organized. The organizations of the codebase is a copy and merge of how others organize their.

2. Why do you have to have 2 things requiring/including rubygame? Why would one suffice? Require is for running rubygame and the include is to load the rubygame lib into that file?
Code: Select all
  require "rubygame"
  include Rubygame



Require is for loading a library so you can use it. Using include Rubygame save you the trouble of typing Rubygame::Rect.new and such.

3. What does the "::" mean? Whats this called in ruby?
Code: Select all
@queue = Rubygame::EventQueue.new()



It means that you're using a module, I think.
I write libre games. My libre game programming service is also availiable for anybody that want to pay.

I ran the Libregamewiki, the free gaming encyclopedia.
kiba
 
Posts: 53
Joined: Sat Feb 07, 2009 2:13 am

Re: Basic rubygame help

Postby blittergames » Fri May 22, 2009 2:23 am

thanks!
blittergames
 
Posts: 4
Joined: Thu May 21, 2009 2:52 am


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron