#NEWLINE# def _add_terrain( self , start , end ) : #NEWLINE# #INDENT# w = int ( ( self . width * 0.1 ) ) #NEWLINE# steps = range ( ( start + ( w / 2 ) ) , ( end + ( w / 2 ) ) , w ) #NEWLINE# y_jitter = [ ] #NEWLINE# freq = ( ( 4.5 / self . width ) + self . rng . uniform ( ( - 0.01 ) , 0.01 ) ) #NEWLINE# for step in steps : #NEWLINE# #INDENT# jitter = ( ( self . height * 0.125 ) * math . sin ( ( ( freq * step ) + self . rng . uniform ( 0.0 , 0.5 ) ) ) ) #NEWLINE# y_jitter . append ( jitter ) #NEWLINE# #UNINDENT# y_pos = [ int ( ( ( self . height / 2.0 ) + y_jit ) ) for y_jit in y_jitter ] #NEWLINE# for i in range ( 0 , len ( steps ) ) : #NEWLINE# #INDENT# self . terrain_group . add ( Terrain ( ( steps [ i ] , y_pos [ i ] ) , self . speed , self . width , self . height ) )