This project demonstrates a tile map generator and renderer built with Rust, utilizing ggez
for rendering and rusqlite
for storing the generated maps in a SQLite database. It features dynamic map generation, where users can regenerate and store maps with a simple key press.
- 2D tile map generation with different biomes (Forest, Desert, Water).
- Real-time rendering of the generated map using
ggez
. - Map storage functionality with SQLite using
rusqlite
. - Dynamic regeneration of maps and database storage with the press of a key.
Ensure you have Rust and Cargo installed on your system. You can install them from the official Rust website.
- Clone the repository:
git clone https://github.com/microchipgnu/tiles-rs.git
cd tiles-rs
- Build the project:
cargo build
- Run the application:
cargo run
- R: Regenerate the map and store it in the database.
- Escape: Quit the application.
src/main.rs
: Entry point of the application and event handling.src/map_generator.rs
: Contains the logic for generating the map.src/tiles.rs
: Defines theTile
,Biome
, andMap
structures.src/db.rs
: Handles storing the map in a SQLite database.
ggez
: For rendering the tile map.rusqlite
: For SQLite database interactions.noise
: For generating Perlin noise used in map generation.rand
: For generating random numbers and offsets in map generation.
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions or improvements.
This project is licensed under the MIT License - see the LICENSE file for details.