Sha256: 82e9f2e9920a60869c3a80d41cfbafd9ac41c3173b67608c74a2fd29480a91c6

Contents?: true

Size: 593 Bytes

Versions: 3

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true

# tick allow you to automatise any action counting
# it can be added into any new created particle ex: here a dummy

new({ particle: :dummy }) do |_p|
  tick(:dummy )
end

new({ particle: :dummy2 }) do |_p|
  tick(:dummy2 )
end

a=box
a.dummy(:hi)

puts a.tick[:dummy]
a.dummy(:ho)
puts a.tick[:dummy]

a.dummy2(:ho)
puts a.tick[:dummy2]

c=circle({left: 99})

c.touch(true) do
  c.tick(:my_counter)
  puts  c.tick[:my_counter]
end

bb=box({left: 333})

bb.touch(true) do
  if   bb.tick(:my_counter)%2 == 0
    bb.color(:red)
  else
    bb.color(:blue)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
atome-0.5.7.6.5 vendor/assets/src/medias/utils/examples/particles/tick/example.rb
atome-0.5.7.6.0 vendor/assets/application/examples/tick.rb
atome-0.5.7.5.9 vendor/assets/application/examples/tick.rb