<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Game Programming With Ruby</title>
	<atom:link href="http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/</link>
	<description>Cross Platform Game Development</description>
	<lastBuildDate>Wed, 24 Mar 2010 20:57:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: François</title>
		<link>http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/comment-page-1/#comment-13697</link>
		<dc:creator>François</dc:creator>
		<pubDate>Wed, 24 Mar 2010 20:57:48 +0000</pubDate>
		<guid isPermaLink="false">http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/#comment-13697</guid>
		<description>Thanx Tony</description>
		<content:encoded><![CDATA[<p>Thanx Tony</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: François</title>
		<link>http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/comment-page-1/#comment-13696</link>
		<dc:creator>François</dc:creator>
		<pubDate>Wed, 24 Mar 2010 20:39:55 +0000</pubDate>
		<guid isPermaLink="false">http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/#comment-13696</guid>
		<description>ok, problem solved :

queue = EventQueue.new
queue.enable_new_style_events #important
queue.each do&#124;e&#124;
      return if e.is_a?(Rubygame::Events::QuitRequested)
	puts &#039;pressed&#039;if e.is_a?(Rubygame::Events::MousePressed)
end

voila!</description>
		<content:encoded><![CDATA[<p>ok, problem solved :</p>
<p>queue = EventQueue.new<br />
queue.enable_new_style_events #important<br />
queue.each do|e|<br />
      return if e.is_a?(Rubygame::Events::QuitRequested)<br />
	puts &#8216;pressed&#8217;if e.is_a?(Rubygame::Events::MousePressed)<br />
end</p>
<p>voila!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/comment-page-1/#comment-13695</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Wed, 24 Mar 2010 20:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/#comment-13695</guid>
		<description>François,

Try changing Rubygame::MouseButtonEvent to Rubygame::MouseDownEvent (or Rubygame::MouseUpEvent)

It should work after that.

Tony</description>
		<content:encoded><![CDATA[<p>François,</p>
<p>Try changing Rubygame::MouseButtonEvent to Rubygame::MouseDownEvent (or Rubygame::MouseUpEvent)</p>
<p>It should work after that.</p>
<p>Tony</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: François</title>
		<link>http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/comment-page-1/#comment-13694</link>
		<dc:creator>François</dc:creator>
		<pubDate>Wed, 24 Mar 2010 20:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://gamedevgeek.com/2007/11/20/game-programming-with-ruby/#comment-13694</guid>
		<description>Hi! I&#039;m a newbie on Ruby and I&#039;m trying to understand the basics of rubygame, using your example and expanding it. I have a problem trying to intercept a simple mousePress event. The interpreter seems to not recognize the MouseButtonEvent class that I use in a cast is_a to intercept the mouse event. In some other files,other events are intercepted that way... (like KeyDownEvent, QuitEvent)

here I programmed a simple queue loop which will return if a mouse button is pressed:

queue.each do&#124;e&#124;
      return if e.is_a?(Rubygame::MouseButtonEvent)
end

the interpreter tells me this:

game.rb:261:in `main_loop&#039;: uninitialized constant Rubygame::MouseButtonEvent (NameError)
	from C:/Ruby/lib/ruby/gems/1.8/gems/rubygame-2.6.2/lib/rubygame/queue.rb:110:in `_old_each&#039;
	from C:/Ruby/lib/ruby/gems/1.8/gems/rubygame-2.6.2/lib/rubygame/queue.rb:110:in `each&#039;
	from game.rb:260:in `main_loop&#039;
	from game.rb:256:in `loop&#039;
	from game.rb:256:in `main_loop&#039;
	from game.rb:294

after some research, I tried to put this before the queue loop:

 queue.enable_new_style_events

no effect... I&#039;m feeling kinda helpless. Any advice would be very welcome

Best regards

François</description>
		<content:encoded><![CDATA[<p>Hi! I&#8217;m a newbie on Ruby and I&#8217;m trying to understand the basics of rubygame, using your example and expanding it. I have a problem trying to intercept a simple mousePress event. The interpreter seems to not recognize the MouseButtonEvent class that I use in a cast is_a to intercept the mouse event. In some other files,other events are intercepted that way&#8230; (like KeyDownEvent, QuitEvent)</p>
<p>here I programmed a simple queue loop which will return if a mouse button is pressed:</p>
<p>queue.each do|e|<br />
      return if e.is_a?(Rubygame::MouseButtonEvent)<br />
end</p>
<p>the interpreter tells me this:</p>
<p>game.rb:261:in `main_loop&#8217;: uninitialized constant Rubygame::MouseButtonEvent (NameError)<br />
	from C:/Ruby/lib/ruby/gems/1.8/gems/rubygame-2.6.2/lib/rubygame/queue.rb:110:in `_old_each&#8217;<br />
	from C:/Ruby/lib/ruby/gems/1.8/gems/rubygame-2.6.2/lib/rubygame/queue.rb:110:in `each&#8217;<br />
	from game.rb:260:in `main_loop&#8217;<br />
	from game.rb:256:in `loop&#8217;<br />
	from game.rb:256:in `main_loop&#8217;<br />
	from game.rb:294</p>
<p>after some research, I tried to put this before the queue loop:</p>
<p> queue.enable_new_style_events</p>
<p>no effect&#8230; I&#8217;m feeling kinda helpless. Any advice would be very welcome</p>
<p>Best regards</p>
<p>François</p>
]]></content:encoded>
	</item>
</channel>
</rss>
