Git Product home page Git Product logo

java-map-generator's Introduction

Java-Map-Generator

This is an example class (without any actual purpose) of how to create a Random Map with X amount of different types of terrains (for example Mountains, Forests, Lakes -water-, etc).

The main difficulty is to generate all this elements in an array and still look "natural". Its not only to generate random map elements in the array, but to make them look like it's an actual terrain.

/Thanks to Arturo @Turin for helping me out with the JFrame part/

Testing

This code was using IntelliJ Community Edition (2016.2.2). You can download the full project from Github and run it in your computer. If you don't have IntelliJ, it should be enough to compile the package (com.daniloramirezcr) to run it. I will update soon the console command to compile and run in a terminal without any IDE.

Set up

The Main.java class has some variables that can modify the behavior of the application.

width       =   The width of the desire map
height      =   The height of the desire map
tolerance   =   The tolerance level of the map. The higher the number, the more times it will run all over the map to check inconsistencies and orphan MapElements.

I recomend testing with 100x100 for medium-end machines.

More information can be found in the Doc folder (Auto-generated by the IntelliJ Java Doc.

Copyright

All the code belongs to Danilo Ramírez Mattey and covered with the Apache Licence 2.0. Please, if you are going to use this code give me some credit for it.

java-map-generator's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.