@@ -21,16 +21,16 @@ def initialize(app)
2121 # This has to go backwards so that the objects bounce off the top of the
2222 # surface. This "edgechain" will only work in one direction!
2323 ( width + 10 ) . step ( -10 , -5 ) do |x |
24- # Doing some stuff with perlin noise to calculate a surface that points
24+ # Doing some stuff with OpenSimplex2 noise to calculate a surface that points
2525 # down on one side and up on the other
2626 if x > width / 2
27- @y = 100 + ( width - x ) * 1.1 + map1d ( noise ( xoff ) , ( 0 ..1.0 ) , ( -80 ..80 ) )
27+ @y = 100 + ( width - x ) * 1.1 + map1d ( noise ( xoff ) , ( - 1. 0 ..1.0 ) , ( -80 ..80 ) )
2828 else
29- @y = 100 + x * 1.1 + map1d ( noise ( xoff ) , ( 0 ..1.0 ) , ( -80 ..80 ) )
29+ @y = 100 + x * 1.1 + map1d ( noise ( xoff ) , ( - 1. 0 ..1.0 ) , ( -80 ..80 ) )
3030 end
3131 # Store the vertex in screen coordinates
3232 surface << Vec2 . new ( x , y )
33- # Move through perlin noise
33+ # Move through simplex noise
3434 xoff += 0.1
3535 end
3636 # Build an array of vertices in Box2D coordinates
@@ -133,4 +133,4 @@ def make_body(x, y, r)
133133 body . set_linear_velocity ( Vec2 . new ( rand ( -10 ..10 ) , rand ( 5 ..10 ) ) )
134134 body . set_angular_velocity ( rand ( -10 ..10 ) )
135135 end
136- end
136+ end
0 commit comments