samples/contributed/animator.rb in ruby-processing-1.0.11 vs samples/contributed/animator.rb in ruby-processing-2.4.1
- old
+ new
@@ -4,16 +4,16 @@
# -- omygawshkenas
FRAME_COUNT = 12
def setup
+ size 350, 350
@frames = []
@last_time = 0
@current_frame = 0
@draw = false
- @back_color = 204
- size 350, 350
+ @back_color = 204
stroke_weight 4
smooth
background @back_color
FRAME_COUNT.times { @frames << get() }
end
@@ -25,11 +25,16 @@
@last_time = time
end
line(pmouse_x, pmouse_y, mouse_x, mouse_y) if @draw
end
-def mouse_pressed; @draw = true; end
-def mouse_released; @draw = false; end
+def mouse_pressed
+ @draw = true
+end
+
+def mouse_released
+ @draw = false
+end
def key_pressed
background @back_color
@frames.size.times {|i| @frames[i] = get()}
end
\ No newline at end of file