commit 250c3a510a5d994604ff86a65df4b0be26ce27f7 Author: Swrup Date: Sun Nov 28 17:53:11 2021 +0100 brrrrbrrr diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..2dff00e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "montociel" +version = "0.1.0" +edition = "2021" + +[dependencies] +bevy = "0.5" +bevy_rapier2d = "*" +rand = "*" + +[package.metadata.android] +build_targets = ["aarch64-linux-android", "armv7-linux-androideabi"] +target_sdk_version = 29 +min_sdk_version = 16 diff --git a/assets/cloud.png b/assets/cloud.png new file mode 100644 index 0000000..711a434 Binary files /dev/null and b/assets/cloud.png differ diff --git a/assets/earth.png b/assets/earth.png new file mode 100644 index 0000000..1509522 Binary files /dev/null and b/assets/earth.png differ diff --git a/assets/fonts/FiraMono-Medium.ttf b/assets/fonts/FiraMono-Medium.ttf new file mode 100644 index 0000000..1e95ced Binary files /dev/null and b/assets/fonts/FiraMono-Medium.ttf differ diff --git a/assets/fonts/FiraSans-Bold.ttf b/assets/fonts/FiraSans-Bold.ttf new file mode 100644 index 0000000..95e1660 Binary files /dev/null and b/assets/fonts/FiraSans-Bold.ttf differ diff --git a/assets/montociel.png b/assets/montociel.png new file mode 100644 index 0000000..78ad1e9 Binary files /dev/null and b/assets/montociel.png differ diff --git a/src/cloud.rs b/src/cloud.rs new file mode 100644 index 0000000..a45e278 --- /dev/null +++ b/src/cloud.rs @@ -0,0 +1,190 @@ +use crate::AppState; +use crate::Materials; +use bevy::prelude::*; +use bevy_rapier2d::prelude::*; +extern crate rand; + +pub struct Cloud(Vec2); +struct NewCloudTimer(Timer); +pub struct Evil; +pub struct CloudPlugin; + +impl Plugin for CloudPlugin { + fn build(&self, app: &mut AppBuilder) { + app.init_resource::() + .add_system_set( + SystemSet::on_enter(AppState::InGame) + .with_system(cloud_belt.system()) + .with_system(spawn_earth.system()), + ) + .add_system_set( + SystemSet::on_update(AppState::InGame) + .with_system(cloud_kinematics.system()) + .with_system(newcloud_maker.system()), + ) + .add_system_set( + SystemSet::on_update(AppState::GameOver) + .with_system(cloud_kinematics.system()) + .with_system(newcloud_maker.system()), + ); + } +} + +impl Default for NewCloudTimer { + fn default() -> Self { + NewCloudTimer(Timer::from_seconds(2., true)) + } +} + +fn newcloud_maker( + mut commands: Commands, + rapier_config: Res, + materials: Res, + time: Res