  ox, oy, ow, oh = 50, 93, 15, 15
  rx, ry, rw, rh = 10, 85, 5, 30
  lx, ly, lw, lh = 285, 85, 5, 30
  dirx, diry  = 1, 1
  velx, vely = 2, 2

  owd = ox + ow
  ohg = oy + oh
  ocx = ox + ow/2
  ocy = oy + oh/2
  
  rwd = rx + rw
  rhg = ry + rh
  rcx = rx + rw/2
  rcy = ry + rh/2
 
  lwd = lx + lw
  lhg = ly + lh
  lcx = lx + lw/2
  lcy = ly + lh/2

 Shoes.app :width => 300, :height => 200 do 
  @o = oval rand, rand, ow, oh    
  @r = rect rx, ry, rw, rh    
  @l = rect lx, ly, lw, lh    
  @kp = 85
  @kpl = 85
  pt1 = 0
  pt2 = 0

   # Rebota con los limites del cuadro
  animate (90) do 
      ox += velx * dirx
	  oy += vely * diry
      ocx = ox + ow/2
      ocy = oy + oh/2
      rcx = rx + rw/2
      rcy = ry + rh/2
	  lcx = lx + lw/2
      lcy = ly + lh/2

	  dcr = Math.sqrt((rcx - ocx)**2 + (rcy - ocy)**2)
	  dcl = Math.sqrt((lcx - ocx)**2 + (lcy - ocy)**2)
	  dirx *= -1 if ox > self.width - 20 or ox < 0 or dcr < ow/2 + rw/2 or dcl < ow/2 + lw/2
	  diry *= -1 if oy > self.height - 20 or oy < 0 or dcr < oh/2 + rh/2 or dcl < oh/2 + lh/2
	  @o.move ox, oy 
    pt1 += 0.5 if ox == 0
    pt2 += 0.5 if (ox + (ow*2)) == self.width
	@pt1 = pt1
	@pt2 = pt2
  end

 # Mueve el rectangulo (arriba, abajo) segun la tecla 
  keypress do |kp|
    @kp -= 5 if kp == 'w' and ry > 0
	@kp += 5 if kp == 's' and ry < self.height - rh
    @kpl -= 5 if kp == 'o' and ry > 0
	@kpl += 5 if kp == 'l' and ry < self.height - rh

	end
  animate (20) do 
	  ry = @kp
	  ly = @kpl
	  @r.move rx, ry 
	  @l.move lx, ly 
  end
  # Puntajes
  animate (1) do 
    #pt1.replace @pt1
    #pt2.replace @pt2
	para pt1, :top => 10, :left => 50
	para pt2, :top => 10, :left => 250	
	
  end
	
end  