Permalink
Browse files

merged in martin's dragon example

  • Loading branch information...
1 parent b915cba commit 9ba71444963494dc5ae7647add99ca90a10f6ed4 @jashkenas committed Nov 8, 2009
Showing with 10 additions and 10 deletions.
  1. +10 −10 samples/dragon.rb
View
20 samples/dragon.rb
@@ -1,40 +1,40 @@
-# dragon.rb ruby-processing NB: :alpha is not implemented in vanilla ruby-processing
+# contributed by monkstone
+
load_library 'context_free'
def setup_the_dragon
@dragon = ContextFree.define do
+
rule :start do
dragon :alpha => 1
end
+
rule :dragon do
- square :hue => 0, :brightness => 1, :saturation => 1, :alpha => 0.01
+ square :hue => 0, :brightness => 0, :saturation => 1, :alpha => 0.02
split do
- dragon :size => 1/Math.sqrt(2), :rotation => -45, :x => 0.25, :y => 0.25
+ dragon :size => 1/Math.sqrt(2), :rotation => -45, :x => 0.25, :y => 0.25
rewind
dragon :size => 1/Math.sqrt(2), :rotation => 135, :x => 0.25, :y => 0.25
rewind
end
end
+
end
end
-
def setup
- size 600, 400
+ size 800, 500
setup_the_dragon
smooth
draw_it
- save_frame("dragon.png")
end
-
def draw
# Do nothing.
end
-
def draw_it
background 255
- @dragon.render :start, :size => width*0.8, :stop_size => 2,
- :start_x => width/3, :start_y => height/3
+ @dragon.render :start, :size => width*0.8, :stop_size => 2,
+ :start_x => width/3, :start_y => height/3.5
end

0 comments on commit 9ba7144

Please sign in to comment.