Strict Standards: Non-static method phpbb_feed_factory::init() should not be called statically in /home/jacius/rubygame/forums/feed.php on line 66
[phpBB Debug] PHP Notice: in file /feed.php on line 171: Cannot modify header information - headers already sent by (output started at /feed.php:66)
[phpBB Debug] PHP Notice: in file /feed.php on line 172: Cannot modify header information - headers already sent by (output started at /feed.php:66)
Rubygame Forums 2010-12-17T23:47:24+00:00 2010-12-17T23:47:24+00:00 <![CDATA[Rubygame `rsdl X.rb` throws Bus Error?]]> I've installed the Rubygame Mac Pack, and am calling my sample script as `rsdl sample1.rb` and have removed the shebang from the beginning of sample1.rb, but I'm seeing a Bus Error when I try to run `rsdl sample1.rb`.
I've tried making the file executable, but there was no change.
I've made sure there is a 'meanie.png' file in the directory with the sample1.rb file, no change.

The exact output is
$ rsdl sample1.rb
/Library/Ruby/Gems/1.8/gems/nice-ffi-0.4/lib/nice-ffi/library.rb:143: [BUG] Bus Error
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

Abort trap

The sample script's contents are
require "rubygems"
require "rubygame"

include Rubygame

@screen = [ 640, 480]

# Defines a class for an example object in the game that will have a
# representation on screen ( a sprite)
class Meanie

  # Turn this object into a sprite
  include Sprites::Sprite

  def initialize
    # Invoking the base class constructor is important and yet easy to forget:

    # @image and @rect are expected by the Rubygame sprite code
    @image = Surface.load "meanie.png"
    @rect  = @image.make_rect

    @angle = 2*Math::PI * rand

  # Animate this object.  "seconds_passed" contains the number of ( real-world)
  # seconds that have passed since the last time this object was updated and is
  # therefore useful for working out how far the object should move ( which
  # should be independent of the frame rate)
  def update  seconds_passed

    # This example makes the objects orbit around the center of the screen.
    # The objects make one orbit every 4 seconds
    @angle = ( @angle + 2*Math::PI / 4 * seconds_passed) % ( 2*Math::PI)

    @rect.topleft = [ 320 + 100 * Math.sin(@angle),
                      240 - 100 * Math.cos(@angle)]

  def draw  on_surface
    @image.blit  on_surface, @rect

@clock =
@clock.target_framerate = 60

# Ask Clock.tick() to return ClockTicked objects instead of the number of
# milliseconds that have passed:

# Create a new group of sprites so that all sprites in the group may be updated
# or drawn with a single method invocation.
@sprites =
Sprites::UpdateGroup.extend_object @sprites
3.times do @sprites << end

# Load a background image and copy it to the screen
@background = Surface.load "background.jpg"
@background.blit @screen, [ 0, 0]

@event_queue =

should_run = true
while should_run do

  seconds_passed = @clock.tick().seconds

  @event_queue.each do |event|
    case event
      when Events::QuitRequested, Events::KeyReleased
        should_run = false

  # "undraw" all of the sprites by drawing the background image at their
  # current location ( before their location has been changed by the animation)
  @sprites.undraw @screen, @background

  # Give all of the sprites an opportunity to move themselves to a new location
  @sprites.update  seconds_passed

  # Draw all of the sprites
  @sprites.draw @screen


The observant reader will notice that its the Sprites sample script from the Starting Simple page on the Rubygame wiki.
Any help is appreciated, thanks :)

Statistics: Posted by click170 — Fri Dec 17, 2010 11:47 pm