https://github.com/bitbrain/chunx
Java 2D chunk engine to generate "infinite" worlds.
https://github.com/bitbrain/chunx
2d biomes chunks engine libgdx slick2d
Last synced: 2 months ago
JSON representation
Java 2D chunk engine to generate "infinite" worlds.
- Host: GitHub
- URL: https://github.com/bitbrain/chunx
- Owner: bitbrain
- License: gpl-2.0
- Created: 2013-08-23T21:02:05.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-01-22T10:43:20.000Z (over 6 years ago)
- Last Synced: 2025-02-28T17:46:58.018Z (3 months ago)
- Topics: 2d, biomes, chunks, engine, libgdx, slick2d
- Language: Java
- Size: 226 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Java 2D chunk engine to generate "infinite" worlds.
### How it works
[](https://www.youtube.com/watch?v=s4XnjuU8nsM)
To create a chunk system, simply look at the following code:
```java
ChunkTarget target = new Character(); // You have to write your own implementation
ContentProvider provider = new World(); // You have to write your own implementation
CachedChunkConfiguration configuration = new SimpleCachedChunkConfiguration();
configuration.setFocused(target);
configuration.setContentProvider(provider);
configuration.setCacheSize(4);ChunkSystem chunkSystem = new ConcurrentChunkSystem(new SimpleCachedChunkSystem(configuration));
chunkSystem.start();
```
Now you can work with the chunk system in your game code:
```java
Chunk chunk = chunkSystem.getActiveChunk();// The system is focused and has an active chunk
if (chunk != null) {int indexX = chunk.getIndexX();
int indexY = chunk.getIndexY();
System.out.println("The current index is: " + indexX + "|" + indexY);
}
```### Getting started
Read [the official wiki](https://github.com/MyRealityCoding/chunx/wiki) for more information.
### Download
You can download the newest bundle [here](https://www.dropbox.com/sh/h5eixlxtj5wkfya/gxacHRVHcc).
### Credits
[chunx](https://github.com/MyRealityCoding/chunx) has been developed by [Miguel Gonzalez](http://my-reality.de).