A simple implementation of the classic Battleship game using the Bevy game engine in Rust.
- 1 human player vs 1 computer player
- 10x10 board for each player
- ECS-based architecture (Entities, Components, Systems)
- Board and cell grid logic
- Ready for further development (ships, UI, gameplay)
-
Install Rust: https://rustup.rs/
-
Clone this repository
-
Run the game:
cargo run
src/components.rs- ECS components and data typessrc/systems.rs- Game systems (setup, camera, etc.)src/resources.rs- Global resources (game state)src/main.rs- App entry point
For a rapid inner development loop, you can use cargo-watch and cargo-update.
Install them with:
cargo install cargo-watch cargo-updateThen, you can automatically check, build, and run your project on file changes with:
cargo watch -x check -x build -x runThis will re-run your code every time you save a file, speeding up your workflow.
Here are some official Bevy examples you can explore:
- hello_world: The simplest Bevy app.
- ecs_guide: A comprehensive ECS usage guide.
- Examples on GitHub
- Bevy Book: Examples
- Bevy Cheat Book: Examples
- breakout: A full game example.
- sprite: Basic 2D sprite rendering.
- 3d_scene: Basic 3D scene setup.