Sha256: 1cedde7c0b722905aabc32c4b8eb230b2d251ecdf938b6951351908c9f448b41

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

xspeed, yspeed = 8.4, 6.6
xdir, ydir = 1, 1

Shoes.app do
  background "#{DIR}/static/stripe.png"

  mask do
    @icon = image "#{DIR}/static/shoes-icon.png", :left => 100, :top => 100 do
      alert "You're soooo quick."
    end
    title "STATIC !", weight: "ultrabold", :left => 150, :top => 150
    @s = star 230,100,7, 50, 25
  end

  x, y = self.width / 2, self.height / 2
  size = @icon.size
  animate(30) do |f|
    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
    @s.toggle if f % 10 == 0
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
scarpe-0.4.0 examples/legacy/not_checked/simple/mask2.rb
scarpe-0.3.0 examples/legacy/not_checked/simple/mask2.rb
scarpe-0.2.2 examples/legacy/not_checked/simple/mask2.rb
lacci-0.2.1 examples/legacy/not_checked/simple/mask2.rb
scarpe-0.2.1 examples/legacy/not_checked/simple/mask2.rb
scarpe-0.2.0 examples/legacy/not_checked/simple/mask2.rb