https://github.com/alexfdez1010/dungeon_crawler
A dungeon crawler written in Rust đĻ and deployed with WebAssembly đ
https://github.com/alexfdez1010/dungeon_crawler
game game-development procedural-generation rust web-assembly
Last synced: about 1 month ago
JSON representation
A dungeon crawler written in Rust đĻ and deployed with WebAssembly đ
- Host: GitHub
- URL: https://github.com/alexfdez1010/dungeon_crawler
- Owner: alexfdez1010
- License: mit
- Created: 2023-11-19T17:19:18.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-25T08:39:47.000Z (over 1 year ago)
- Last Synced: 2024-10-24T10:06:16.198Z (6 months ago)
- Topics: game, game-development, procedural-generation, rust, web-assembly
- Language: Rust
- Homepage: https://alexfdez1010.github.io/dungeon_crawler/
- Size: 2.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Dungeon Crawler đ
This work is based in the book [Hands-on Rust: Effective Learning through 2D Game Development and Play](https://pragprog.com/titles/hwrust/hands-on-rust/) by Herbert Wolverson. đ The book offers an excellent introduction to Rust and game development. I highly recommend it! đ You'll be able to learn Rust while understanding common design patterns in video games. đšī¸
## Play the Game đŽ
First, the most important part: you can play the game [right here](https://alexfdez1010.github.io/dungeon_crawler/)! The game operates with WebAssembly and is playable directly in your browser. No installation needed â just dive right in! đ You will need a keyboard to play, though.
### Controls đšī¸
- Use the `Arrow keys` to move and attack (if an enemy is in the position you're moving to).
- Press `G` to pick up items and store them in your inventory.
- Keys `1-9` are for using items in your inventory.
- With the `Mouse`, hover over any enemy or item to see its stats.### Goal đ
The ultimate goal of the game is to recover the `Amulet of Yala`. đ The game concludes when you reach the tile where the Amulet is located. You can find it on the last level of the dungeon (level 3). Advance to the next level by finding the stairs scattered around each level.
### Enemies đš
You'll encounter 4 types of enemies:
- `Goblin`: the weakest, with 1 health point and 1 attack point.
- `Orc`: a bit tougher, having 2 health points and 1 attack point.
- `Ogre`: a stronger foe, with 5 health points and 2 attack points.
- `Ettin`: the mightiest adversary, boasting 20 health points and 5 attack points. There's only one Ettin in the game, guarding the Amulet of Yala. It's the final boss â consider avoiding it to snag the Amulet! đĄī¸### Items đĻ
Discover 7 types of items:
- `Healing Potion`: Restores 6 health points.
- `Weak Healing Potion`: Restores 2 health points.
- `Vision Potion`: Permanently extends your vision range by one tile in all directions.
- `Rusty Sword`: Boosts attack points by 1. Only one sword can be carried at a time.
- `Shiny Sword`: Increases attack points by 2.
- `Huge Sword`: Amplifies attack points by 4.
- `Dungeon Map`: Reveals the entire level map. A new map is needed for each level.### Level Design đēī¸
The levels are procedurally generated using the Drunkard's Walk algorithm and Cellular Automata. They ensure a path from the starting point to the stairs for the next level. Enemy and item placements are randomized, offering infinite replayability! The map is endless â reach the edge, and you'll teleport to the opposite side.
## Development đ ī¸
The game is crafted in Rust, utilizing the `bracket-lib` library for the game engine. The architecture follows the ECS (Entity Component System) pattern, using the `Legion` library.
### Compiling and Running the Game đĨī¸
To compile the game for your platform, you'll need Rust and Cargo. Instructions can be found [here](https://www.rust-lang.org/tools/install). Compile the game with:
```bash
cargo build --release
```Run the game using:
```bash
cargo run --release
```### Compiling and Running the Game for the Web đ
To compile for the web, execute:
```bash
./generate_wasm.sh
```This command handles all necessary dependencies and compiles the game for web play. Use any web server to serve the game from `index.html`. Note: A web server is required for local development due to WebAssembly's needs.
## Contributing and Bugs đ
Encountered a bug or want to contribute? Feel free to open an issue or a pull request. I'm eager to collaborate! đ¤
## License đ
This project is under the MIT License - see the `LICENSE.md` file for details.