<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -148,46 +148,37 @@ class PandaBall &lt; Sprite
 	
 	def _draw_sdl( camera )
 		trans = camera.world_to_screen(:pos =&gt; @body.p, :size =&gt; @size)
-		trans[:size] *= 23.0
+		trans[:size] *= 22.0
 
 		camera.mode.surface.draw_circle_s( trans[:pos].to_ary, trans[:size], @color )
-		
-		rect = Rect.new(0,0,trans[:size]*2,trans[:size]*2)
-		rect.center = trans[:pos].to_ary
-		
-		camera.mode.dirty_rects &lt;&lt; rect
-		
-		super
-	end
-	
-	def _undraw_sdl( camera )
-		trans = camera.world_to_screen(:pos =&gt; @body.p, :size =&gt; @size)
-		trans[:size] *= 23.0
-		
-		rect = Rect.new(0,0,trans[:size]*2+2,trans[:size]*2+2)
+
+		rect_size = 2*trans[:size]+4 # extra padding
+
+		rect = Rect.new( [0, 0, rect_size, rect_size] )
 		rect.center = trans[:pos].to_ary
-		
-		bg = camera.mode.background
-		bg.blit( camera.mode.surface, rect, rect )
-		
-		camera.mode.dirty_rects &lt;&lt; rect
-		
+
+		@_dirty_rects &lt;&lt; rect
+
 		super
 	end
 end
 
 # Create the SDL window
-screen = Screen.set_mode([320,240])
-#screen = Screen.set_mode([640,480])
+#screen = Screen.set_mode([320,240])
+screen = Screen.set_mode([640,480])
 
 # Make the background surface
 background = Surface.new(screen.size)
 
-camera_mode = Camera::RenderModeSDL.new(screen, background, screen.make_rect, 1.0)
-scene = Scene.new( camera_mode )
+camera_options = {
+	:mode =&gt; Camera::RenderModeSDL.new(screen, background, screen.make_rect, 1.0),
+	:size =&gt; screen.size
+}
+scene = Scene.new( camera_options )
 
-#scene.camera.position = vect(160,120)
-#scene.camera.zoom = 2
+scene.camera.position = vect(160,150)
+#scene.camera.position = vect(320,240)
+scene.camera.rotation = 0.4
 
 
 scene.space.gravity = vect(0,400)
@@ -216,6 +207,39 @@ class &lt;&lt; scene
 		@camera.mode.surface.update
 	end
 	
+	def rotate_cw
+		@camera.rotation += 0.2
+	end
+
+	def rotate_ccw
+		@camera.rotation -= 0.2
+	end
+
+	def zoom_in
+		@camera.zoom *= 1.1
+	end
+
+	def zoom_out
+		@camera.zoom *= 0.9
+		@camera.zoom = 0.1 if @camera.zoom &lt; 0.1
+	end
+	
+	def move_left
+		@camera.position.x -= 25
+	end
+	
+	def move_right
+		@camera.position.x += 25
+	end
+	
+	def move_up
+		@camera.position.y -= 25
+	end
+	
+	def move_down
+		@camera.position.y += 25
+	end
+	
 end
 
 p = PandaBall.new( scene, vect(100,50) )
@@ -224,6 +248,14 @@ p.name = &quot;George&quot;
 # When the event on the left happens, call the method on the right.
 # It's so easy, it's magic!
 scene.magic_hooks(:mouse_right  =&gt;  :add_panda,
+                  :mouse_wheel_up   =&gt;  :zoom_in,
+                  :mouse_wheel_down =&gt;  :zoom_out,
+                  :left         =&gt;  :move_left,
+                  :right        =&gt;  :move_right,
+                  :up           =&gt;  :move_up,
+                  :down         =&gt;  :move_down,
+                  :comma        =&gt;  :rotate_ccw,
+                  :period       =&gt;  :rotate_cw,
                   :print_screen =&gt;  :take_screenshot,
                   :r            =&gt;  :refresh,
                   :s            =&gt;  :toggle_smooth,
@@ -231,6 +263,7 @@ scene.magic_hooks(:mouse_right  =&gt;  :add_panda,
                   :escape       =&gt;  Proc.new{ throw :quit },
                   QuitEvent     =&gt;  Proc.new{ throw :quit })
 
+
 puts &quot;Left click and hold  = grab ball&quot;
 puts &quot;Middle click = bounce ball&quot;
 puts &quot;Right click = create Ball&quot;
@@ -257,6 +290,25 @@ floor = Sprite.new( scene ) {
 	@name = &quot;floor&quot;
 }
 
+class &lt;&lt; floor
+	
+	def _draw_sdl( camera )
+		surf = camera.mode.surface
+		@shapes.each { |s|
+			a = scene.camera.world_to_screen(:pos =&gt; s.ta)[:pos].to_a
+			b = scene.camera.world_to_screen(:pos =&gt; s.tb)[:pos].to_a
+			surf.draw_line_a( a, b, :black )
+
+			left, right  = [a[0], b[0]].sort
+			top,  bottom = [a[1], b[1]].sort
+			@_dirty_rects &lt;&lt; Rect.new( [left, top, right-left+5, bottom-top+5] )
+		}
+		
+		super
+	end
+	
+end
+
 
 # Filling with colors in a variety of ways
 background.fill( Color::ColorRGB.new([0.1, 0.2, 0.35]) )
@@ -264,10 +316,6 @@ background.fill( :black, [70,120,80,80] )
 background.fill( &quot;dark red&quot;, [80,110,80,80] )
 
 
-floor.shapes.each { |s|
-	background.draw_line_a( scene.camera.world_to_screen(:pos =&gt; s.ta)[:pos],
-													scene.camera.world_to_screen(:pos =&gt; s.tb)[:pos], :black )
-}
 
 # Refresh the screen once. During the loop, we'll use 'dirty rect' updating
 # to refresh only the parts of the screen that have changed.</diff>
      <filename>samples/demo_rubygame3.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>24de8b9c314dff24f3211c49ac1507438a8d589d</id>
    </parent>
  </parents>
  <author>
    <name>John Croisant</name>
    <email>jacius@gmail.com</email>
  </author>
  <url>http://github.com/jacius/rubygame/commit/1190a32d6547d3d4518147039f2c4954f7a17272</url>
  <id>1190a32d6547d3d4518147039f2c4954f7a17272</id>
  <committed-date>2008-05-18T10:06:16-07:00</committed-date>
  <authored-date>2008-05-18T10:06:16-07:00</authored-date>
  <message>Moved trunk to branches/3.0.0</message>
  <tree>43dcc3f0cc603543bef04296d3ec30dab3303256</tree>
  <committer>
    <name>John Croisant</name>
    <email>jacius@gmail.com</email>
  </committer>
</commit>
