Permalink
Browse files

Big blocky background which scrolls faster.

  • Loading branch information...
1 parent a64a2d6 commit 24b97798e96a8f9437282f27ce93e9d48fefe6be @pda committed Jan 16, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 asc.rb
View
6 asc.rb
@@ -113,12 +113,14 @@ def color_equal? other
class Background
PALETTE = [ 16, 232, 233 ]
- PERIOD = 5.0
- SPEED = 10.0
+ PERIOD = 16.0
+ SPEED = 32.0
+ BLOCKINESS = 10.0
def pixel x, y, char = " "
Pixel.new char, 0, color(x, y)
end
def color x, y
+ y = (y / BLOCKINESS).round * BLOCKINESS
sin = Math.sin((x + Time.new.to_f * SPEED) / PERIOD + y / PERIOD)
PALETTE[(0.9 * sin + 0.9).round]
end

0 comments on commit 24b9779

Please sign in to comment.