Sha256: 6453187d654f077d221ae0f0dacb9ce29db8b6cd88490f475af1287c571cb6cd
Contents?: true
Size: 740 Bytes
Versions: 29
Compression:
Stored size: 740 Bytes
Contents
%w[xot beeps rays reflex] .map {|s| File.expand_path "../../../#{s}/lib", __dir__} .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)} require 'reflexion/include' COLORS = [:red, :green, :blue, :orange, :yellow, :indigo, :pink, :peach, :brown] count = 0 setup do size 600, 400 gravity 0, 9.8 * meter end draw do text "#{event.fps.to_i} FPS | #{count} BLOCKS", 10, 10 end pointer do if down? || drag? count += 1 if window.add View.new { pos event.pos size rand 20..40 background event.right? ? :gray : COLORS.sample dynamic event.left? shape [RectShape, EllipseShape].sample.new(density: 1) interval(1) {fill rand, rand, rand} } end end
Version data entries
29 entries across 29 versions & 1 rubygems