public
Description: Flexible cross-platform game programming library for Ruby
Homepage: http://rubygame.org
Clone URL: git://github.com/jacius/rubygame.git
rubygame / README
100644 123 lines (82 sloc) 4.079 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
 = Rubygame README
 
 == What is Rubygame?
 
 Rubygame is a cross-platform game-development extension and library for Ruby,
 inspired by Pygame. The purpose of Rubygame is to empower game developers by
 providing them with powerful and flexible high-level concepts. Instead of
 worrying about low-level technical details, you can focus your energy on
 more interesting things (like making a fun game).
 
 Rubygame's core is written in C to bind low-level SDL functions in ruby.
 On top of that is a pure ruby library for higher-level behavior like
 event and game object management.
 
 There are two other Ruby-SDL bindings which are worth mentioning: Ruby/SDL
 and RUDL. Ruby/SDL is a simple wrapper which closely mirrors SDL's C API,
 while RUDL tries to provide some high-level concepts.
 The main differences with Rubygame come down to a matter of priorities:
 a great deal of care and effort goes into making Rubygame especially clean,
 well-documented, powerful, and easy to use.
 
 === Relevant Links
 1. Rubygame: http://rubygame.sourceforge.net
 2. Ruby: http://www.ruby-lang.org
 3. Pygame: http://www.pygame.org
 4. SDL: http://www.libsdl.org
 5. Ruby/SDL: http://www.kmc.gr.jp/~ohai/rubysdl.en.html
 6. RUDL: http://rudl.sourceforge.net
 
 == Requirements
 
 You will definitely need these software packages to compile Rubygame:
 
 * ruby >= 1.8
 * SDL >= 1.2.7
 * rake >= 0.7.0 (for build/install system)
 
 It's highly recommended that you have these packages as well, or some
 cool features won't be available!
 
 * SDL_gfx >= 2.0.10
 * SDL_image >= 1.2.3
 * SDL_mixer >= 1.2.7
 * SDL_ttf >= 2.0.6
 
 (If you don't have some of those, you have to disable those features
 by passing some flags to the build process. See "Advanced Install", below.)
 
 If you are compiling source on a binary-based Linux ditribution,
 you will also need the "dev" packages of ruby, SDL, SDL_gfx, SDL_image,
 SDL_mixer, and SDL_ttf. (Really, you just need the header files.)
 
 And of course, if you are compiling the source, you will need a C compiler!
 These versions of gcc worked fine when I tried them; other compilers might
 work too:
 
 * gcc 3.3, 3.4, 4.0, 4.1
 
 
 == Install
 
 === Basic Install
 
 Extract the archive and enter its top directory.
 Then run ($ indicates as user, # as root):
 
  $ rake build
  # rake install
 
 === Advanced Install
 
 You can provide flags to configure how the build and install tasks run.
 Flags are provided in an environmental variable, RUBYGAME_CONFIG.
 (Yes, I know this is an ugly hack. At least you only have to do it once.)
 
 Try this command to see all the possible configuration flags:
 
  $ RUBYGAME_CONFIG="--help" rake
 
 IMPORTANT: if you are missing any optional SDL_* libraries, you must specify
 "--no-*" flags for those libraries. For example, if you don't have SDL_gfx:
 
  $ RUBYGAME_CONFIG="--no-gfx" rake build
 
 If you don't disable the features, the compile will probably fail when it
 looks for the headers and libraries. (The build system is not smart enough to
 automatically disable missing features.)
 
 === Generating documentation
 
 You can generate documentation for Rubygame's API by running:
 
  # rake rdoc
 
 Documentation will be generated as HTML in the 'html' directory.
 Open 'html/index.html' in a web browser to get started.
 
 == Usage
 
 To use Rubygame in an application, do:
 
   require 'rubygame'
 
 You will probably also want a display window and event queue:
 
   screen = Rubygame::Screen.new( [640,480] )
   queue = Rubygame::EventQueue.new()
 
 For more information, see the documentation (online at
 http://rubygame.sourceforge.net, or generated locally with the
 'rake rdoc' command). You should also take a peek at the demo applications
 in the 'samples' directory.
 
 == License
 
 Rubygame is distributed under the terms of the GNU Lesser GPL.
 See LICENSE for more details.
 
 Some of the sample files are distributed under other licenses than the
 GNU Lesser GPL. See 'samples/README' and 'samples/GPL' for more details.
 
 John Croisant (jacius at users.sourceforge.net)