├── assets ├── bird.png ├── pipe.png ├── cloud_1.png ├── cloud_2.png ├── mountain.png ├── GameOverText.png ├── SpaceToStart.png └── fonts │ └── Kenney Future Narrow.ttf ├── flappy_bevy_preview.gif ├── src ├── gamedata.rs ├── physics.rs ├── bounds_deletion.rs ├── screens.rs ├── main.rs ├── clouds.rs ├── animation.rs ├── gamestate.rs ├── mountains.rs ├── pipes.rs └── bird.rs ├── LICENSE ├── .gitignore ├── Cargo.toml ├── .vscode └── launch.json └── README.md /assets/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/bird.png -------------------------------------------------------------------------------- /assets/pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/pipe.png -------------------------------------------------------------------------------- /assets/cloud_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/cloud_1.png -------------------------------------------------------------------------------- /assets/cloud_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/cloud_2.png -------------------------------------------------------------------------------- /assets/mountain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/mountain.png -------------------------------------------------------------------------------- /assets/GameOverText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/GameOverText.png -------------------------------------------------------------------------------- /assets/SpaceToStart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/SpaceToStart.png -------------------------------------------------------------------------------- /flappy_bevy_preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/flappy_bevy_preview.gif -------------------------------------------------------------------------------- /assets/fonts/Kenney Future Narrow.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TanTanDev/flappy_bevy/HEAD/assets/fonts/Kenney Future Narrow.ttf -------------------------------------------------------------------------------- /src/gamedata.rs: -------------------------------------------------------------------------------- 1 | use crate::gamestate; 2 | use gamestate::GameState; 3 | 4 | pub struct GameData { 5 | pub game_state: GameState, 6 | pub score: i32, 7 | } 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | flappy_bevy is dual-licensed under either 2 | 3 | * MIT License (docs/LICENSE-MIT or http://opensource.org/licenses/MIT) 4 | * Apache License, Version 2.0 (docs/LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) 5 | 6 | at your option. 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "flappy_bevy" 3 | version = "0.1.0" 4 | authors = ["TanTanDev"] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | #bevy = "0.1.2" 11 | bevy = {git = "https://github.com/bevyengine/bevy.git", rev = "25f62f72"} 12 | rand = "0.7.3" 13 | 14 | # Override breaking change, transitive via bevy_asset, which auto-resolves to 5.0.0-pre.13 15 | notify = "=5.0.0-pre.2" -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "lldb", 9 | "request": "launch", 10 | "name": "Debug", 11 | "program": "${workspaceFolder}/target/debug/flappy_bevy.exe", 12 | "args": [], 13 | "cwd": "${workspaceFolder}" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](flappy_bevy_preview.gif) 2 | 3 | A game like flappy bird made for the bevy engine 4 | 5 | License 6 | 7 | flappy bevy is free and open source! All code in this repository is dual-licensed under either: 8 | 9 | * MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT) 10 | * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) 11 | 12 | Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. 13 | -------------------------------------------------------------------------------- /src/physics.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | pub struct Velocity(pub Vec2); 4 | 5 | pub struct Gravity(pub f32); 6 | pub struct AffectedByGravity; 7 | 8 | pub struct PhysicsPlugin; 9 | 10 | impl Plugin for PhysicsPlugin { 11 | fn build(&self, app: &mut AppBuilder) { 12 | app.add_system(velocity_system.system()) 13 | .add_system(gravity_system.system()); 14 | } 15 | } 16 | 17 | fn gravity_system( 18 | gravity: Res, 19 | time: Res