Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4441c7c

Browse files
committed
cleanup; reset game state when going to main menu; update demo vids
1 parentde70846 commit4441c7c

File tree

19 files changed

+111
-104
lines changed

19 files changed

+111
-104
lines changed

‎Cargo.lock‎

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ serde = "1"
101101
thiserror ="2.0.12"
102102
# Leave only high-severity logs in native build
103103
log = {version ="0.4",features = ["max_level_debug","release_max_level_warn"] }
104-
# Leave only high-severity logs in web build
105-
tracing = {version ="0.1",features = ["max_level_debug","release_max_level_warn"] }
106104
# keep the following in sync with Bevy's dependencies
107105
winit = {version ="0.30",default-features =false }
108106

109107
[target.'cfg(target_arch="wasm32")'.dependencies]
110108
firewheel-web-audio = {git ="https://github.com/CorvusPrudens/firewheel-web-audio" }
109+
# Leave only high-severity logs in web build
110+
tracing = {version ="0.1",features = ["max_level_debug","release_max_level_warn"] }
111111

112112
# LINT
113113

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
#3D RPG Bevy game template (WIP)
3-
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/778dd6c0-3722-42c3-ad4a-f3424ac588e2"controls="controls"> </video>
4-
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/0bbc555b-53ce-4e2a-bdab-d1219f857b6d"controls="controls"> </video>
5-
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/8692a08e-73c6-411a-b060-a971470e623a"controls="controls"> </video>
6-
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/72a324f8-195c-4608-aaf2-b88a1ba03896"controls="controls"> </video>
3+
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/95595cf1-10e0-451f-a390-26e614db183b"controls="controls"> </video>
4+
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/45388412-9b6e-4503-bf70-ff75618cea0d"controls="controls"> </video>
5+
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/cf22aa05-1332-40ea-b057-5c596e62f8e7"controls="controls"> </video>
6+
<videowidth="320"height="240"src="https://github.com/user-attachments/assets/d26afc33-8cea-4265-884c-9bb33b569566"controls="controls"> </video>
77

88
This template is based on the awesome[BevyFlock 2D template][BevyFlock] featuring out of the box builds for:
99
- Windows

‎src/crates/asset_loading/mod.rs‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,32 @@ pub use tracking::*;
1010

1111
pubfnplugin(app:&mutApp){
1212
// start asset loading
13-
//app.load_resource_from_path::<Fira>("fonts/FiraCode-Regular.ttf");
1413
app.add_plugins(tracking::plugin)
1514
.add_plugins(RonAssetPlugin::<Config>::default())
1615
.load_resource_from_path::<Config>("config.ron")
1716
.add_plugins(RonAssetPlugin::<Credits>::default())
1817
.load_resource_from_path::<Credits>("credits.ron")
1918
.load_resource::<AudioSources>()
2019
.load_resource::<Textures>()
20+
// .load_resource::<Fonts>()
2121
.load_resource::<Models>();
2222
}
2323

24-
#[derive(Asset,Clone,Reflect,Resource)]
25-
#[reflect(Resource)]
26-
pubstructFonts{
27-
#[dependency]
28-
pubfira:Handle<Font>,
29-
}
24+
// #[derive(Asset, Clone, Reflect, Resource)]
25+
// #[reflect(Resource)]
26+
// pub struct Fonts {
27+
// #[dependency]
28+
// pub custom: Handle<Font>,
29+
// }
30+
//
31+
// impl FromWorld for Fonts {
32+
// fn from_world(world: &mut World) -> Self {
33+
// let assets = world.resource::<AssetServer>();
34+
// Self {
35+
// custom: assets.load("fonts/custom.ttf"),
36+
// }
37+
// }
38+
// }
3039

3140
#[derive(Asset,Clone,Reflect,Resource)]
3241
#[reflect(Resource)]

‎src/crates/asset_loading/tracking.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl LoadResource for App {
4040
path:implAsRef<Path>,
4141
) ->&mutSelf{
4242
self.init_asset::<T>();
43-
lethandle ={
43+
let_handle ={
4444
let world =self.world_mut();
4545
let assets = world.resource::<AssetServer>();
4646
let handle:Handle<T> = assets.load::<T>(path.as_ref());
@@ -60,8 +60,8 @@ impl LoadResource for App {
6060
assets:Res<Assets<T>>|{
6161
for eventin events.read(){
6262
match event{
63-
AssetEvent::Modified{ id}if*id ==handle.id() =>{
64-
ifletSome(asset) = assets.get(&handle){
63+
AssetEvent::Modified{ id}if*id ==_handle.id() =>{
64+
ifletSome(asset) = assets.get(&_handle){
6565
commands.insert_resource(asset.clone());
6666
}
6767
}

‎src/crates/game/mod.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ use bevy::prelude::*;
33
use bevy_seedling::prelude::*;
44

55
mod camera;
6-
#[cfg(any(debug_assertions, not(feature ="web")))]
6+
#[cfg(any(feature ="dev_native", not(feature ="web")))]
77
mod dev_tools;
88
mod mood;
99

1010
pubfnplugin(app:&mutApp){
11-
app.insert_resource(Score(0));
11+
//app.insert_resource(Score(0));
1212
app.add_plugins((
1313
models::plugin,
1414
camera::plugin,
1515
scene::plugin,
1616
player::plugin,
1717
mood::plugin,
18-
#[cfg(debug_assertions)]
18+
#[cfg(any(feature ="dev_native",not(feature ="web")))]
1919
dev_tools::plugin,
2020
));
2121
}
2222

23-
#[derive(Default,Resource)]
24-
pubstructScore(pubi32);
23+
//#[derive(Default, Resource)]
24+
//pub struct Score(pub i32);

‎src/crates/game/mood.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn change_mood(
5555
settings:Res<Settings>,
5656
sources:Res<AudioSources>,
5757
mutstate:ResMut<GameState>,
58-
music:Query<Entity,(With<SamplerPool<Music>>,Without<SamplerPool<Sfx>>)>,
58+
music:Query<Entity,With<SamplerPool<Music>>>,
5959
mutcommands:Commands,
6060
){
6161
let mood =&on.0;

‎src/crates/models/ext_traits.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use bevy::gltf::GltfMesh;
2727
/// ));
2828
/// }
2929
/// ```
30+
#[allow(dead_code)]
3031
pubtraitSpawnCollidingMesh{
3132
fnspawn_colliding_mesh(
3233
&mutself,

‎src/crates/models/palette.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ use bevy::prelude::*;
22

33
pubconstGRAY:Color =Color::srgb(0.157,0.157,0.157);
44
pubconstWHITEISH:Color =Color::srgb(0.925,0.925,0.925);
5-
pubconstSAND_YELLOW:Color =Color::srgb(205. /255.,170. /255.,109. /255.);
6-
7-
pubconstGREEN:Color =Color::srgb(0.286,0.878,0.373);
5+
// pub const SAND_YELLOW: Color = Color::srgb(205. / 255., 170. / 255., 109. / 255.);
6+
// pub const GREEN: Color = Color::srgb(0.286, 0.878, 0.373);
87
pubconstDIM_BLUE:Color =Color::srgb(0.186,0.328,0.573);
98
pubconstLIGHT_BLUE:Color =Color::srgb(0.286,0.478,0.773);
109

‎src/crates/models/primitives.rs‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
usesuper::*;
22

33
/// Macro to hide the derive trait boilerplate
4-
macro_rules!declare_markers{
4+
macro_rules!markers{
55
( $( $name:ident),*) =>{
66
$(
77
#[derive(Component,Reflect,Clone)]
@@ -11,17 +11,16 @@ macro_rules! declare_markers {
1111
};
1212
}
1313

14-
declare_markers!(
14+
markers!(
1515
SceneCamera,
1616
// scene
1717
Sun,
1818
Moon,
19-
Combat,
20-
Exploration,
21-
Drama,
19+
// Combat,
20+
// Exploration,
2221
// TODO: The idea is to create a boombox with spatial audio
2322
// <https://github.com/bevyengine/bevy/blob/main/examples/audio/spatial_audio_3d.rs>
24-
Boombox,
23+
//Boombox,
2524
SunCycleLabel,
2625
// user input context
2726
GlobalInputCtx,
@@ -36,21 +35,23 @@ declare_markers!(
3635
TabBar,
3736
TabContent,
3837
DisabledButton,
39-
Slider,
40-
SliderThumb,
41-
Checkbox,
38+
//Slider,
39+
//SliderThumb,
40+
//Checkbox,
4241
GeneralVolumeLabel,
4342
MusicVolumeLabel,
4443
SfxVolumeLabel,
45-
DiagnosticsLabel,
46-
DebugUiLabel,
4744
SaveSettingsLabel,
45+
VsyncLabel,
4846
FovLabel,
4947
// animations
5048
FadeIn,
5149
FadeOut
5250
);
5351

52+
#[cfg(feature ="dev_native")]
53+
markers!(DiagnosticsLabel,DebugUiLabel);
54+
5455
macro_rules! timers{
5556
( $( $name:ident),*) =>{
5657
$(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp