没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > gosub |
gosub
|
0 | 0 | 24 |
贡献者 | 讨论 | 代码提交 |
Gosub is a collection of utility classes and extensions to Gosu that are (hopefully) generic enough to be used in just about any 2D game.
There are a few additions to Gosu itself, such as the ability to use symbols (including letters!) for buttons:
window.button_down? :left_control
window.button_down? :zNew drawing shortcuts:
window.draw_quad 0, 0, 128, 128, Color.black
window.draw_pixel 32, 32, Color.white
image.draw_tiled 0, 0, window.width, window.height, 0, :tile_width => 32, :tile_height => 32Lots of helper classes:
class Bomb < Actor
def initialize
@image = Gosu::Image.load window, 'images/bomb.png', true
@pos = Point.new(window.width * rand, window.height * rand)
Timer.after 3.seconds do
Sound.play :bomb_explode
remove_from_world
end
super
end
def draw
@image.draw_rot @pos.x, @pos.y, z_order, 0
end
end
bomb = Bomb.new
bomb.add_to_world