Ruby · クリエイティブコーディング · v0.1.0
asobi
Ruby で、絵と遊ぶ。持って、増やして、並べる。
gem install asobigem install asobi と打ってから、ターミナルで asobi と打ちます。ブラウザでスケッチが開きます。 RubyGems で見る
require "asobi"
flower = petal(40, 16).repeat(10).in_fan.colored(from: :hotpink, to: :gold, around: true)
comet = circle(4).colored(:white).orbit(62, every: 6).trail(12)
sky = flower.animate(2) { |f, t| f.rotate(t * 36) } + comet
show sky.glowing, on: :black, grain: true
再生中: asobi.rb
require "asobi"
flower = petal(40, 16).repeat(10).in_fan.colored(from: :hotpink, to: :gold, around: true)
comet = circle(4).colored(:white).orbit(62, every: 6).trail(12)
sky = flower.animate(2) { |f, t| f.rotate(t * 36) } + comet
show sky.glowing, on: :black, grain: true
require "asobi"
petals = petal(50, 18).repeat(8).in_fan.colored(:deeppink, :cyan)
spinning = petals.animate(2) { |flower, t| flower.rotate(t * 90) }
show spinning.trail(4).glowing.blended(:screen), on: :black, grain: true
require "asobi"
ribbon = wave(240, 30, 2).outlined(:springgreen, width: 14)
bands = ribbon.repeat(3).change_each { |w, t, i| w.move(down: i * 14).colored(hsl(150 + i * 50)) }
show bands.drift(right: 40, every: 6).blurred(4).blended(:screen), on: :midnightblue, grain: true
require "asobi"
stripes = rect(10, 90).repeat(12).in_row(gap: 4).colored(from: :crimson, to: :gold, angle: 90)
show stripes.spin(every: 6).clipped_by(heart(70)), on: :navy
require "asobi"
stars = star(radius: 4).repeat(40).change_each { |s, t| s.grow(to: 0.6 + t) }
sky = stars.colored(:gold).scattered(over: [320, 180]).glowing.fade(every: 3, to: 0.4).one_by_one
show sky + moon(size: 40).colored(:ivory).glowing(8).move(right: 110, up: 50), on: :midnightblue
紹介映像 · 32秒 · 音楽あり
Your Objects
3つの数字が3つの円に。Flower オブジェクトの花びらが星に変わり、回転しながら光の軌跡を描きます。
01 / asobi の考え
asobi の考え
- 01
オブジェクトを絵として扱い、絵をオブジェクトとして扱う。
- 02
書く人が楽しく、わかりやすく、すぐに遊べることが大事。
- 03
絵はシールのようなもの。作って、増やして、並べても、やっぱり1枚の絵。
02 / ステップ
言葉をひとつずつ
どの段も、それだけで動くスケッチです。言葉をひとつ足すと、絵が答えます。
-
01
petal
形。
遊び場で開くshow petal -
02
repeat
8枚。まだ同じ場所に重なっています。
遊び場で開くshow petal.repeat(8) -
03
in_fan
扇に並べる。
遊び場で開くshow petal.repeat(8).in_fan -
04
colored
2色が交互に。
遊び場で開くshow petal.repeat(8).in_fan.colored(:deeppink, :cyan) -
05
glowing
黒の上で光る。
遊び場で開くshow petal.repeat(8).in_fan.colored(:deeppink, :cyan).glowing, on: :black -
06
spin
そして動く。
遊び場で開くshow petal.repeat(8).in_fan.colored(:deeppink, :cyan).glowing.spin(every: 8), on: :black
03 / 見本集
見本集から
04 / リファレンス
すべての言葉を1ページに
71 の言葉、9 のまとまり。どれにも動く絵が付いています。
22語