-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|207|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Generators


 
Pakz
Created : 30 May 2019
 
Language : Monkey2

Rivers on a top down map.

Create 2d Rivers

Latest Update



What the code does is create a river on a map. It starts by creating a random point somewhere middish on the map and then carves into two directions until it reaches the edge of the map. The direction of the river wil slightly change.

There is a "brush tip" that is used to draw the current position of the river. This is the width of the river. This also changes randomly.

In the example press Space to Generate new River.

Code is commented...

 

Comments