diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/console.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/console.rb b/test/console.rb new file mode 100644 index 0000000..c7d29c4 --- /dev/null +++ b/test/console.rb @@ -0,0 +1,25 @@ +require 'ruby2d' + +s1 = Square.new(x: 0, y: 0, size: 100, color: 'white') +s2 = Square.new(x: 100, y: 100, size: 50, color: 'green') +c = 0.0 +switch = true + +update do + + if switch + c += 0.01 + if c > 1.0 + switch = false + end + else + c -= 0.01 + if c < 0.0 + switch = true + end + end + + s1.color = [1, 1, 1, c] +end + +show |
