Sha256: 2c4b35027a7218d9a8cc15e7b033830a002b3af9a3d99a41d81b853320461442

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

Shoes.app title: 'potacho', width: 175, height: 160 do
  background tan

  @imgs = []
  1.upto 59 do |i|
    @imgs << image(File.expand_path(File.join(__FILE__, "../potato_chopping/1258_s#{format('%03d', i)}.gif"))).hide
    @imgs.last.move(10, 10)
  end

  @imgs.first.show

  def potacho
    @imgs[58].hide
    a = animate 12 do |i|
      @imgs[i].show
      @imgs[i - 1].hide if i.positive?
      a.remove if i > 57
    end
  end

  button('  start  ') { potacho }.move 10, 130
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-4.0.0.rc1 samples/good_potato_chopping.rb