{"id":34760920,"url":"https://github.com/pnstack/template-bevy","last_synced_at":"2026-04-19T16:03:00.044Z","repository":{"id":327687236,"uuid":"1109653160","full_name":"pnstack/template-bevy","owner":"pnstack","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-06T04:46:01.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-08T12:23:29.257Z","etag":null,"topics":["bevy","game","rust","template"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pnstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["nvp2k1"]}},"created_at":"2025-12-04T05:14:52.000Z","updated_at":"2025-12-06T04:46:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pnstack/template-bevy","commit_stats":null,"previous_names":["pnstack/template-bevy"],"tags_count":null,"template":true,"template_full_name":"pnstack/template-rust","purl":"pkg:github/pnstack/template-bevy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnstack%2Ftemplate-bevy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnstack%2Ftemplate-bevy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnstack%2Ftemplate-bevy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnstack%2Ftemplate-bevy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pnstack","download_url":"https://codeload.github.com/pnstack/template-bevy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnstack%2Ftemplate-bevy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32012787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","game","rust","template"],"created_at":"2025-12-25T06:24:12.372Z","updated_at":"2026-04-19T16:03:00.034Z","avatar_url":"https://github.com/pnstack.png","language":"Rust","funding_links":["https://github.com/sponsors/nvp2k1"],"categories":[],"sub_categories":[],"readme":"# Template Bevy\n\nA Bevy game engine template designed for indie game developers. This template provides a solid foundation with organized modules for components, systems, resources, states, and plugins.\n\n## Features\n\n- 🎮 Bevy game engine with ECS architecture\n- 📁 Organized folder structure for game development\n- 🧩 Modular plugin system\n- 🎯 Game state management (Loading, Menu, Playing, Paused, GameOver)\n- 🏃 Movement and physics components\n- 🤖 Auto-movement system for obstacles and NPCs\n- 💥 AABB collision detection system\n- 🎯 Dynamic obstacle spawning with randomization\n- 📷 Smooth camera follow system\n- 🎨 User interface with score display and health bar\n- ❤️ Health and combat systems\n- 🎵 Audio and settings resources\n- 🧪 Comprehensive test suite\n- 🚀 CI/CD with GitHub Actions\n- 📦 Cross-platform builds\n- 🐳 Docker support\n- ❄️ Nix flakes for reproducible environments\n\n## Installation\n\n### From Source\n\n```bash\ngit clone https://github.com/pnstack/template-bevy.git\ncd template-bevy\ncargo build --release\n```\n\n### Quick Development Build\n\nFor faster compile times during development, use the `dev` feature:\n\n```bash\ncargo run --features dev\n```\n\n### From Releases\n\nDownload the latest binary from the [Releases](https://github.com/pnstack/template-bevy/releases) page.\n\n## Usage\n\n### Running the Game\n\n```bash\n# Development build (faster compilation)\ncargo run --features dev\n\n# Release build (optimized)\ncargo run --release\n```\n\n### Controls\n\n- **A/D** or **Arrow Left/Right** - Move player horizontally\n- **Spacebar** - Jump (only when on ground)\n- **ESC** - Quit game\n\n## Project Structure\n\n```\ntemplate-bevy/\n├── .github/workflows/    # CI/CD workflows\n├── src/\n│   ├── components/       # ECS components (Player, Health, Speed, etc.)\n│   ├── systems/          # ECS systems (movement, setup, etc.)\n│   ├── resources/        # Global resources (Score, Settings, Timer)\n│   ├── states/           # Game states (Loading, Menu, Playing, etc.)\n│   ├── plugins/          # Custom Bevy plugins\n│   ├── game/             # Core game logic and constants\n│   ├── lib.rs            # Library root\n│   └── main.rs           # Application entry point\n├── assets/\n│   ├── textures/         # Sprites and images\n│   ├── audio/            # Music and sound effects\n│   └── fonts/            # Custom fonts\n├── tests/                # Integration tests\n├── examples/             # Usage examples\n└── docs/                 # Documentation\n```\n\n## Architecture\n\n### Components\n\nComponents are data containers attached to entities:\n\n```rust\nuse template_bevy::components::{Player, Health, Speed};\n\n// Spawn a player entity\ncommands.spawn((\n    Player,\n    Health::new(100.0),\n    Speed(200.0),\n    Transform::default(),\n));\n```\n\n### Systems\n\nSystems process entities with specific components:\n\n```rust\nfn player_movement(\n    keyboard_input: Res\u003cButtonInput\u003cKeyCode\u003e\u003e,\n    mut query: Query\u003c(\u0026Speed, \u0026mut Transform), With\u003cPlayer\u003e\u003e,\n) {\n    // Movement logic here\n}\n```\n\n### Resources\n\nResources are global state:\n\n```rust\nuse template_bevy::resources::{Score, GameSettings};\n\nfn update_score(mut score: ResMut\u003cScore\u003e) {\n    score.add(100);\n}\n```\n\n### States\n\nStates control game flow:\n\n```rust\nuse template_bevy::states::GameState;\n\napp.add_systems(Update, gameplay_system.run_if(in_state(GameState::Playing)));\n```\n\n## Core Systems\n\nThe template includes several ready-to-use systems:\n\n### Auto-Movement\n\nEntities with the `AutoMove` component will automatically move in the specified direction:\n\n```rust\nuse template_bevy::components::{AutoMove, Obstacle};\n\n// Create an obstacle that moves left\ncommands.spawn((\n    Obstacle,\n    AutoMove::left(150.0), // Speed of 150 pixels/second\n    // ... other components\n));\n```\n\n### Obstacle Spawning\n\nThe `spawn_obstacles` system automatically spawns obstacles at regular intervals with random properties (position, size, speed).\n\n### Camera Follow\n\nThe camera automatically follows the player with smooth interpolation:\n\n```rust\nuse template_bevy::components::{CameraFollow, MainCamera};\n\n// Camera will smoothly follow the target\ncommands.spawn((\n    MainCamera,\n    CameraFollow::new(player_entity)\n        .with_offset(Vec3::new(0.0, 50.0, 0.0))\n        .with_smoothing(0.05),\n    Camera2dBundle::default(),\n));\n```\n\n### Collision Detection\n\nAABB collision detection between player and obstacles:\n\n- Platform collisions for landing and ground detection\n- Obstacle collisions that apply damage to the player\n\n### User Interface\n\nBuilt-in UI components for displaying game information:\n\n- **Score Display**: Shows current score in the top-left corner\n- **Health Bar**: Visual health indicator with color changes based on health level\n\n## Development\n\n### Prerequisites\n\n- Rust 1.70 or later\n- For Linux: `libasound2-dev`, `libudev-dev` (audio and input support)\n\n```bash\n# Ubuntu/Debian\nsudo apt-get install libasound2-dev libudev-dev\n\n# Fedora\nsudo dnf install alsa-lib-devel systemd-devel\n```\n\n### Building\n\n```bash\n# Debug build\ncargo build\n\n# Release build (optimized)\ncargo build --release\n\n# Development build with dynamic linking (faster iteration)\ncargo build --features dev\n```\n\n### Running Tests\n\n```bash\ncargo test\n```\n\n### Running Clippy (Linter)\n\n```bash\ncargo clippy -- -D warnings\n```\n\n### Formatting Code\n\n```bash\ncargo fmt\n```\n\n## Adding Game Content\n\n### Adding a New Component\n\n1. Create the component in `src/components/mod.rs`:\n\n```rust\n#[derive(Component, Debug)]\npub struct Enemy {\n    pub damage: f32,\n}\n```\n\n2. Export it in the module.\n\n### Adding a New System\n\n1. Create a new file in `src/systems/`:\n\n```rust\npub fn enemy_ai(query: Query\u003c\u0026Transform, With\u003cEnemy\u003e\u003e) {\n    // AI logic\n}\n```\n\n2. Export it in `src/systems/mod.rs`\n3. Register it in `src/plugins/mod.rs`\n\n### Adding a New State\n\n1. Add the state variant in `src/states/mod.rs`\n2. Add state-specific systems in your plugin\n\n## Performance Tips\n\n1. Use `--features dev` during development for faster compile times\n2. Use `--release` for testing actual game performance\n3. The template includes optimized dependency builds by default\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Ensure all tests pass\n6. Submit a pull request\n\n## License\n\nThis project is licensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnstack%2Ftemplate-bevy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpnstack%2Ftemplate-bevy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnstack%2Ftemplate-bevy/lists"}