Method: AnimatedWaveDemo#reverser
- Defined in:
-
sample/demos-en/aniwave.rb,
sample/demos-jp/aniwave.rb
Oscillation handler. This detects whether to reverse the direction of the wave by checking to see if the peak of the wave has moved off the screen (whose size we know already.)
99 100 101 102 103 104 105 |
# File 'sample/demos-en/aniwave.rb', line 99 def reverser if @waveCoords[0][1] < 10 @direction = :right elsif @waveCoords[-1][1] < 10 @direction = :left end end |