Sha256: 4003d3b176b899cb55e541b33bb6a01cac2f78bdbbbef78572ef33996a38f5e4
Contents?: true
Size: 515 Bytes
Versions: 15
Compression:
Stored size: 515 Bytes
Contents
xspeed, yspeed = 8.4, 6.6 xdir, ydir = 1, 1 Shoes.app do background "#DFA" border black, :strokewidth => 6 nostroke @icon = image "#{DIR}/static/shoes-icon.png", :left => 100, :top => 100 do alert "You're soooo quick." end x, y = self.width / 2, self.height / 2 size = @icon.size animate(30) do x += xspeed * xdir y += yspeed * ydir xdir *= -1 if x > self.width - size[0] or x < 0 ydir *= -1 if y > self.height - size[1] or y < 0 @icon.move x.to_i, y.to_i end end
Version data entries
15 entries across 9 versions & 4 rubygems