Generic Game Template

From Rubygame

Jump to: navigation, search
(New page: <source lang="ruby"> #!/usr/bin/env ruby # This is just a blank window that I use as the starting point for all my games require 'rubygems' require 'rubygame' class Game def initialize...)
Line 10: Line 10:
def initialize
def initialize
@screen = Rubygame::Screen.new [640,480], 0, [Rubygame::HWSURFACE, Rubygame::DOUBLEBUF]
@screen = Rubygame::Screen.new [640,480], 0, [Rubygame::HWSURFACE, Rubygame::DOUBLEBUF]
-
 
@screen.title = "Generic Game!"
@screen.title = "Generic Game!"
-
 
-
 
@queue = Rubygame::EventQueue.new
@queue = Rubygame::EventQueue.new
-
 
@clock = Rubygame::Clock.new
@clock = Rubygame::Clock.new
-
 
@clock.target_framerate = 30
@clock.target_framerate = 30
end
end
Line 41: Line 36:
def draw
def draw
-
 
end
end
end
end

Revision as of 04:19, 7 July 2009

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox