Skip to content

A simple header file that contains procedural noise functions like Simplex and Perlin/FBM for use with GBDK

License

Notifications You must be signed in to change notification settings

Plokie/gbdk-c-noise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

gbdk-c-noise

A simple header file that contains procedural noise functions for use with GBDK. Comparable to basic simplex noise, and includes an experimental perlin noise / fbm noise implementation that I don't think works but might? I'm not sure tbh, I couldn't yield useful results.

Based on the C fbm header by nowl at https://gist.github.com/nowl/828013 and modified using some fixed point stuff i made up

For information on how it works, see the header file comments

Example usage:

//Loop through each x and y coordinate to-be generated
for(uint_fast8_t x=0; x<targetMap_Width; x++) {
    for(uint_fast8_t y=0; y<targetMap_Height; y++) {
    
        uint_fast8_t val = noise2d(x*45,y*45); //Sample simplex noise
        
        if(val<128) set_element(x,y,water); //Below ocean level
        else set_element(x,y,grass); //Above ocean level = land (grass)
    }
}

Demonstration

Screenshot of a GameBoy game, demonstrating the usage of the noise <3

About

A simple header file that contains procedural noise functions like Simplex and Perlin/FBM for use with GBDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages