Ruby Sketch ((free)) < CERTIFIED >
require 'ruby2d' set width: 800, height: 600, title: "My Ruby Sketch", background: '#111' on :key_down do |e| clear if e.key == 'r' end
update do @x += 2 @square.x = @x @square.x = 0 if @x > 500 end ruby sketch
100.times do Circle.new( x: rand(800), y: rand(600), radius: rand(5..30), color: ['red', 'green', 'blue', 'yellow', 'purple'].sample, opacity: rand(0.3..0.8) ) end require 'ruby2d' set width: 800, height: 600, title:
show a) Recursive circles (Apollonian-like) require 'ruby2d' set width: 800, height: 600, background: 'black' require 'ruby2d' set width: 800
on :mouse_down do |event| Circle.new(x: event.x, y: event.y, radius: 10, color: 'fuchsia') @points << [event.x, event.y] end
# test.rb require 'ruby2d' set title: "Ruby Sketch Test" Square.new show