From 894d1f117961ad51cb2e08f078d61f04a4eaf76a Mon Sep 17 00:00:00 2001 From: Jeremy Metz Date: Thu, 10 Oct 2024 10:54:45 +0200 Subject: [PATCH] fix: added working bevy demo part of #379 --- templates/apps/bevy-demo/Cargo.toml.hbs | 47 ++- .../apps/bevy-demo/assets/audio/flying.ogg | Bin 0 -> 11646 bytes .../apps/bevy-demo/assets/textures/bevy.png | Bin 0 -> 7288 bytes .../apps/bevy-demo/assets/textures/github.png | Bin 0 -> 6393 bytes templates/apps/bevy-demo/src/lib.rs.hbs | 377 ++++++++---------- 5 files changed, 198 insertions(+), 226 deletions(-) create mode 100644 templates/apps/bevy-demo/assets/audio/flying.ogg create mode 100644 templates/apps/bevy-demo/assets/textures/bevy.png create mode 100644 templates/apps/bevy-demo/assets/textures/github.png diff --git a/templates/apps/bevy-demo/Cargo.toml.hbs b/templates/apps/bevy-demo/Cargo.toml.hbs index 007f0ffd..47a89cb1 100644 --- a/templates/apps/bevy-demo/Cargo.toml.hbs +++ b/templates/apps/bevy-demo/Cargo.toml.hbs @@ -15,11 +15,48 @@ name = "{{app.name}}-desktop" path = "gen/bin/desktop.rs" [dependencies] -mobile-entry-point = "0.1.1" -bevy = "0.3.0" +bevy = { version = "0.14", default-features = false, features = [ + "animation", + "bevy_asset", + "bevy_audio", + "bevy_state", + "bevy_color", + "bevy_gilrs", + "bevy_scene", + "bevy_winit", + "bevy_core_pipeline", + "bevy_pbr", + "bevy_gltf", + "bevy_render", + "bevy_sprite", + "bevy_text", + "bevy_ui", + "multi_threaded", + "png", + "hdr", + "x11", + "vorbis", + "bevy_gizmos", + "tonemapping_luts", + "smaa_luts", + "default_font", + "webgl2", + "sysinfo_plugin", +] } +# bevy_audio = { version = "0.14.2", features = ["cpal"] } +image = { version = "0.25", default-features = false } +log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] } + [target.'cfg(target_os = "android")'.dependencies] -ndk-glue = "0.2.1" +winit = { version = "0.30", default-features = false, features = [ "android-native-activity" ]} +android-activity = "0.6" +android_logger = "0.13" +paste = "1.0" + +[target.'cfg(not(target_os = "android"))'.dependencies] +env_logger = "0.11.5" +winit = { version = "0.30", default-features = false } -[patch.crates-io] -cpal = { git = "https://github.com/francesca64/cpal", branch = "fran-ios" } +[build-dependencies] +embed-resource = "1.4" diff --git a/templates/apps/bevy-demo/assets/audio/flying.ogg b/templates/apps/bevy-demo/assets/audio/flying.ogg new file mode 100644 index 0000000000000000000000000000000000000000..f79b6e3ef16765f1d9e35d8eba4f3b7f1f2ef5a0 GIT binary patch literal 11646 zcmaia1z1!;_xD}8K}wKXnx(sxG?1ki79>TwQBp-> zC6wInF241>-}n6g^UThjJLk?hGiQG1%$a#s&(YBkzytn~7WElqaMg!1@g)#;h@YpI zjk7nd0dk`P_W+YWeJ4>pFGr}G zvyJfud#ENTS+&dIYYpiQ1jyx9NLz-z z;=1x`N#PZKSVRRLV24u)lr)(OmYlCyIkuy#LS?FY4i5SjFnG4WQyc8DklH!wOUxE4iignUn9MjWYS0O4BnhR?uyP zc^OWc-#=hcYLzweUg0a)Bl=UOYZIv@SUa-I`Y}w3Yx{5bsDkTu?;}%B zb_g^up2&utvxqZ=-6w%6C0C*kR=^$?e+yn3s*hmiFZ2nym^l;x!e}l~{LkV7%70N@ zko-(=K;X@g0F(Dx>>_9yXZ z)$-^}2oL{~*4vXFr@Lt&tz*bwInLla$!KpVYdI-nKZ&%T_OqXDus3fEG;R2Y!TdFw z1&r^1SPsraxD?`-ZzmJ{+j4RR;+N#(xiyn{Oq2N@r8!1tl)lK>D1AltUzX$atT_Ey zan!T5sCa?sH0S7yvZhyV165ni|7-r2o!%#;^1?S)q$!ZxJEDa6>yZj#n-oO4(Ut zp}8VY0=hi{zyJVH5`7XMn7l?b`*UxMNRVcu`xN*KQzkTFB56!gFy10s+vTkM3C;cj zG?Uh|>;hWb=t{5?Kn(uK^TrYxAgc5LU_*f*gN36JBe2y(#DK&KD*~=ioMkwoK*AO_ zAVHKJN&_ooH5`HUvW5+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=@-v&Q2k$7+uzM0YZ3T0y z*QUazR!jH-1J}KtJLax&_O$7tH&3p$DFM*NR{-e=J~2 zOBwfzdt`q?Chw$_`dB+`03AV1sY>kNRq~P3=d;uM^G{B8U5tB)Q#4axShB;%In zWOc*22A^-GFA`i2`nan|6$uL%jNzRo%d?N>Se|CnRJ&^B9rK(^wK6jL%EEStw2{n^ zlz9)dh1gW6!8p#kw{COhqtvYIL)AQpY|C3^U<^Wu3gy3Sb%pmURw!6<>ELRs2tWI4 z{3weG)Jp!eL5r%dJR%(s7VV;uq%Prs*GhRIJYSp7FC?x1F_vXkkI!9Nj9v9gz#B-s(}y`{k+C zKFSD(vI66y!QV*N0zevYQ-**Wdq2TG_O&Nt-AZFy_hp_3ix#!OE%6(($l1dBB6{GV z-}YK@PTT#J)qxt`7VKhZ(`zg0$;n6^`G7yZ2Hv83btjRWJ6mOGO)M#}rYB`i%>gJ? z|DR!Q^OTE@nR&K1)9*Y~MBE%BTcVKYXde@M|aL?%?u5S@T9JPda2~_ z?6G$1QJ;|WtVZjj^V@ZSA6P{KUTt&Va!Obn_D-q$et(er_3ajoR>YQB=T#)+{{Xhd B?{)wH literal 0 HcmV?d00001 diff --git a/templates/apps/bevy-demo/assets/textures/bevy.png b/templates/apps/bevy-demo/assets/textures/bevy.png new file mode 100644 index 0000000000000000000000000000000000000000..b869ef692a6f59102449e0a4739b021f8952c81f GIT binary patch literal 7288 zcmZ{JWl$83^Zs$vadaHr-5iayAR*l$@F9+nMq0WX4y2`|5kx>rLOK+XRzez)qlBZ6 zxcm8i`G4`B*_~&f-F;?f_SMd8vVookF_<0<004-eYd$jq0I>drSO5^tKe!IHJNXAV zE>Crz0st*=!UucYf1DMjX`~APgm41@QE>pk-M>^60sshr0sx100Dx=(06^nY+-)fT zuK;w=)_4ZMB*Lfq|1km|O-nxjfCBzM$1)3@UIYLbET2DnY7)G9V&fi6wYS1d*7)=2 zXz9NWH!Ba%^ALqPI{eIl#45A2{-MC>#FX|tOq?OXSK~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ds)5VURrWNU z$Ch#W`<^X+dtT3uSEt*!tKafbO;-hCOY#r6>)Il-G#wS_&9+i?0;QYfo2=gW0Z|F10A+ubpMOHe!YkR4(=F*U{dvavciUll>|Gz8aKt<)xxbm( zVxIY1^6&G;<*#Pp?`ZGuBn$I(`Ue0psFX)v+50#Nd;7W+{gtQx*93U3 MruXclie1eA0q1|QoB#j- literal 0 HcmV?d00001 diff --git a/templates/apps/bevy-demo/assets/textures/github.png b/templates/apps/bevy-demo/assets/textures/github.png new file mode 100644 index 0000000000000000000000000000000000000000..6cb3b705d018006a2bd4200ea94c9d5fb98b6f76 GIT binary patch literal 6393 zcmVt<80drDELIAGL9O(c600d`2O+f$vv5yP-FqK~#7F?VZ1K z8%LJM-y1+@%G#>M+FpAVnW`o4Nbi;iWtR!eHnW`VMWV9HBxRS0%r2Ak7l_I(6B%A4 zD7(xpP8tI` zdHy`?5l{yN>>KPGsz|ZXCE-ZDiK)^X8v1-3TH^jQySG$v&`|AtmZg`gi-nX%J z7Zy5SAmAKW`E$ENgXn!GzMm+=lnn~af|8xilo%}x&loDj(xH!snajcMPvf9w#*g3!jy z56`}%yzuW&oq*jr?(5NQGQ3ToIb=y8%A^_qcYvnI*yz@@$>%af^f0AO< zy3oTc^Ar29O#q}Pv{~v8w7S$P1? zQff=eP!$79vdX^NQdNa`7i7(nwZwn5$*pfSCAZWFcxCPCJ!1ZM0w7=h^2XcmkWFqq zBL%1s@KC(l1VABhM~jHP7qB}fV*WP*pip#(*lPi=zPItnzL5V)0F(lE-hBHH%T~nu zQF|k(yMz$IFjem(P zZv+hS0v-4zVlMcs(-OzD>y&c}9|4+#KWoN&OKN1ueH zw&^MLGK1VIk}etqfIeEXcHJ5-kS9h#vP(DU5qmv$DP+ z0`5?m6ci8VE?}R|d;2f>cWKV+&d0XU9qVqt4|lr=xXS@OKKqXL(!5_Q>+L%>IJ!?I zQq=iy?gAd(?e$>T81GxRW}&vBZZle<8`hNHgH_HLYi*6;$82ct`1xX%Yq@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~zl@PEXZqV6le665iYN?RwECS`hym$7JuT^QhO{H3JOP?+K z>CWm}JCw?;VMP@vkiL(vxrA576=zh!>W)(x3p|b-2NW}`4EPVbW5=qv%&$_}AsEBV z;+D0>U0CB9GP1fA74C>iTHtYDjq6CYt?oFr7()eXToYC| z4_B1&JzuGlc!gRCc!U&xWIo6nlmyGLyv-^UWu&2&0v5!rmTn8&=WD2`)`u(FvBH&M z+HT@yO{uMbM;sl6q105%RWej^DPVZ*PeP$O3wK2A1w3LDA4ABVGE7iOoU8HLUtZKA z3!Q}F;@Gtr>n+1{)22r{1WMz)!Js6lXt$0r?mQsiDU5`?vexb})0QE#aC=*hs&Co* zOB6PLpbU`Y6v+&tE`h0d-&WQaq+RNOY1>-l>uJxCCG%Z}2J$QG8&B=04khK>O%~xk zM0^_$2sj0)+-pUh4i`nd7Gm=>{xdkVqTTPG(gV23$$)?tK& zNi|~SpW1gQF!!f^gSEEC@MAW#2Wy)i2sk6e>R78Rjo{Bazq=nlQEO zPIhAR2|W|hV{2_gSX%%900000000000000000000;FtVA#ht2v8mJ-W00000NkvXX Hu0mjfZ$b4` literal 0 HcmV?d00001 diff --git a/templates/apps/bevy-demo/src/lib.rs.hbs b/templates/apps/bevy-demo/src/lib.rs.hbs index f12cfc76..16aa0011 100644 --- a/templates/apps/bevy-demo/src/lib.rs.hbs +++ b/templates/apps/bevy-demo/src/lib.rs.hbs @@ -1,257 +1,192 @@ -use bevy::{ - prelude::*, - render::pass::ClearColor, - sprite::collide_aabb::{collide, Collision}, -}; -use mobile_entry_point::mobile_entry_point; -/// An implementation of the classic game "Breakout" -#[mobile_entry_point] -fn main() { - App::build() - .add_resource(WindowDescriptor { - title: "{{app.stylized-name}}".to_string(), - ..Default::default() - }) - .add_plugins(DefaultPlugins) - .add_resource(Scoreboard { score: 0 }) - .add_resource(ClearColor(Color::rgb(0.9, 0.9, 0.9))) - .add_startup_system(setup.system()) - .add_system(paddle_movement_system.system()) - .add_system(ball_collision_system.system()) - .add_system(ball_movement_system.system()) - .add_system(scoreboard_system.system()) - .run(); +use bevy::window::WindowMode; +use bevy::{color::palettes::css::PURPLE, prelude::*}; +use winit::event_loop::EventLoop; + +#[cfg(target_os = "android")] +use android_activity::AndroidApp; +#[cfg(target_os = "android")] +use winit::platform::android::EventLoopBuilderExtAndroid; + +#[cfg(target_os = "android")] +fn init_logging() { + android_logger::init_once( + android_logger::Config::default() + .with_max_level(log::LevelFilter::Trace) + .with_tag("hello-bevy"), + ); } -struct Paddle { - speed: f32, +#[cfg(not(target_os = "android"))] +fn init_logging() { + env_logger::init(); } -struct Ball { - velocity: Vec3, +#[bevy_main] +pub fn main() { + init_logging(); + + App::new() + .insert_resource(ClearColor(Color::srgb(0.5, 0.5, 0.9))) + // .init_asset::() + .add_plugins((DefaultPlugins.set(WindowPlugin { + primary_window: Some(Window { + name: Some("{{app.stylized-name}}".to_string()), + resizable: false, + mode: WindowMode::BorderlessFullscreen, + ..default() + }), + ..default() + }),)) + .init_resource::() + .add_systems(Startup, (setup, setup_audio, setup_player)) + .add_systems(Update, (update, handle_touch, move_player)) + .run(); } -struct Scoreboard { - score: usize, +pub fn start_app(){ + // If needed, can differentiate App and Desktop version by editing this + main(); } -enum Collider { - Solid, - Scorable, - Paddle, + +#[derive(Component)] +pub struct Player; + +fn setup(mut commands: Commands) { + commands.spawn(Camera2dBundle::default()); } -fn setup( - mut commands: Commands, - mut materials: ResMut>, - asset_server: Res, -) { - // Add the game's entities to our world - commands - // cameras - .spawn(Camera2dComponents::default()) - .spawn(UiCameraComponents::default()) - // paddle - .spawn(SpriteComponents { - material: materials.add(Color::rgb(0.5, 0.5, 1.0).into()), - transform: Transform::from_translation(Vec3::new(0.0, -215.0, 0.0)), - sprite: Sprite::new(Vec2::new(120.0, 30.0)), - ..Default::default() - }) - .with(Paddle { speed: 500.0 }) - .with(Collider::Paddle) - // ball - .spawn(SpriteComponents { - material: materials.add(Color::rgb(1.0, 0.5, 0.5).into()), - transform: Transform::from_translation(Vec3::new(0.0, -50.0, 1.0)), - sprite: Sprite::new(Vec2::new(30.0, 30.0)), - ..Default::default() - }) - .with(Ball { - velocity: 400.0 * Vec3::new(0.5, -0.5, 0.0).normalize(), - }) - // scoreboard - .spawn(TextComponents { - text: Text { - font: asset_server.load("fonts/FiraSans-Bold.ttf"), - value: "Score:".to_string(), - style: TextStyle { - color: Color::rgb(0.5, 0.5, 1.0), - font_size: 40.0, - }, - }, - style: Style { - position_type: PositionType::Absolute, - position: Rect { - top: Val::Px(5.0), - left: Val::Px(5.0), - ..Default::default() - }, - ..Default::default() - }, - ..Default::default() - }); +#[derive(Resource, Deref)] +struct MoveSound(Handle); - // Add walls - let wall_material = materials.add(Color::rgb(0.8, 0.8, 0.8).into()); - let wall_thickness = 10.0; - let bounds = Vec2::new(900.0, 600.0); +fn setup_audio(mut commands: Commands, asset_server: Res) { + // Create sound resource + let sound = asset_server.load("audio/flying.ogg"); + commands.insert_resource(MoveSound(sound)); +} +fn setup_player(mut commands: Commands, asset_server: Res) { commands - // left - .spawn(SpriteComponents { - material: wall_material.clone(), - transform: Transform::from_translation(Vec3::new(-bounds.x() / 2.0, 0.0, 0.0)), - sprite: Sprite::new(Vec2::new(wall_thickness, bounds.y() + wall_thickness)), - ..Default::default() - }) - .with(Collider::Solid) - // right - .spawn(SpriteComponents { - material: wall_material.clone(), - transform: Transform::from_translation(Vec3::new(bounds.x() / 2.0, 0.0, 0.0)), - sprite: Sprite::new(Vec2::new(wall_thickness, bounds.y() + wall_thickness)), - ..Default::default() - }) - .with(Collider::Solid) - // bottom - .spawn(SpriteComponents { - material: wall_material.clone(), - transform: Transform::from_translation(Vec3::new(0.0, -bounds.y() / 2.0, 0.0)), - sprite: Sprite::new(Vec2::new(bounds.x() + wall_thickness, wall_thickness)), + .spawn(SpriteBundle { + texture: asset_server.load("textures/bevy.png"), + transform: Transform::from_translation(Vec3::new(0., 0., 1.)), ..Default::default() }) - .with(Collider::Solid) - // top - .spawn(SpriteComponents { - material: wall_material, - transform: Transform::from_translation(Vec3::new(0.0, bounds.y() / 2.0, 0.0)), - sprite: Sprite::new(Vec2::new(bounds.x() + wall_thickness, wall_thickness)), - ..Default::default() - }) - .with(Collider::Solid); + .insert(Player); +} - // Add bricks - let brick_rows = 4; - let brick_columns = 5; - let brick_spacing = 20.0; - let brick_size = Vec2::new(150.0, 30.0); - let bricks_width = brick_columns as f32 * (brick_size.x() + brick_spacing) - brick_spacing; - // center the bricks and move them up a bit - let bricks_offset = Vec3::new(-(bricks_width - brick_size.x()) / 2.0, 100.0, 0.0); - let brick_material = materials.add(Color::rgb(0.5, 0.5, 1.0).into()); - for row in 0..brick_rows { - let y_position = row as f32 * (brick_size.y() + brick_spacing); - for column in 0..brick_columns { - let brick_position = Vec3::new( - column as f32 * (brick_size.x() + brick_spacing), - y_position, - 0.0, - ) + bricks_offset; - commands - // brick - .spawn(SpriteComponents { - material: brick_material.clone(), - sprite: Sprite::new(brick_size), - transform: Transform::from_translation(brick_position), - ..Default::default() - }) - .with(Collider::Scorable); - } - } +#[derive(Default, Resource)] +pub struct Actions { + pub player_movement: Option, } -fn paddle_movement_system( - time: Res