diff --git a/assets/level_list.levels.yml b/assets/level_list.levels.yml index dd0d683..1b45ab4 100644 --- a/assets/level_list.levels.yml +++ b/assets/level_list.levels.yml @@ -1,5 +1,5 @@ levels: - - name: test - file: test.lvl.json - name: Beverley Beck - file: beverley.lvl.json \ No newline at end of file + file: beverley.lvl.json + - name: test + file: test.lvl.json \ No newline at end of file diff --git a/assets/levels/test.lvl.json b/assets/levels/test.lvl.json index 5de9752..d145736 100644 --- a/assets/levels/test.lvl.json +++ b/assets/levels/test.lvl.json @@ -1 +1,192 @@ -{"tiles":[[{"tile_type":"City","contents":"None","is_goal":false,"is_wet":false,"height":1},{"tile_type":"City","contents":"None","is_goal":true,"is_wet":false,"height":2},{"tile_type":"City","contents":"None","is_goal":false,"is_wet":false,"height":2},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":1},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0}],[{"tile_type":"City","contents":"None","is_goal":false,"is_wet":false,"height":1},{"tile_type":"City","contents":"None","is_goal":false,"is_wet":false,"height":1},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":2},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":1},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0}],[{"tile_type":"City","contents":"None","is_goal":false,"is_wet":false,"height":0},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0}],[{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":0},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":1},{"tile_type":"Land","contents":"Canal","is_goal":false,"is_wet":true,"height":2},{"tile_type":"Land","contents":"Canal","is_goal":false,"is_wet":true,"height":2}],[{"tile_type":"Land","contents":"Canal","is_goal":false,"is_wet":true,"height":1},{"tile_type":"Land","contents":"Canal","is_goal":false,"is_wet":true,"height":1},{"tile_type":"Land","contents":"Canal","is_goal":false,"is_wet":true,"height":2},{"tile_type":"Land","contents":"Canal","is_goal":false,"is_wet":true,"height":2},{"tile_type":"Land","contents":"None","is_goal":false,"is_wet":false,"height":3}]],"title":"Test Level","width":5,"height":5} \ No newline at end of file +{ + "tiles": [ + [ + { + "tile_type": "City", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 1 + }, + { + "tile_type": "City", + "contents": "None", + "is_goal": true, + "is_wet": false, + "height": 2 + }, + { + "tile_type": "City", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 2 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 1 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + } + ], + [ + { + "tile_type": "City", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 1 + }, + { + "tile_type": "City", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 1 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 2 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 1 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + } + ], + [ + { + "tile_type": "City", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + } + ], + [ + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 0 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 1 + }, + { + "tile_type": "Land", + "contents": "Canal", + "is_goal": false, + "is_wet": true, + "height": 2 + }, + { + "tile_type": "Land", + "contents": "Canal", + "is_goal": false, + "is_wet": true, + "height": 2 + } + ], + [ + { + "tile_type": "Land", + "contents": "Canal", + "is_goal": false, + "is_wet": true, + "height": 1 + }, + { + "tile_type": "Land", + "contents": "Canal", + "is_goal": false, + "is_wet": true, + "height": 1 + }, + { + "tile_type": "Land", + "contents": "Canal", + "is_goal": false, + "is_wet": true, + "height": 2 + }, + { + "tile_type": "Land", + "contents": "Canal", + "is_goal": false, + "is_wet": true, + "height": 2 + }, + { + "tile_type": "Land", + "contents": "None", + "is_goal": false, + "is_wet": false, + "height": 3 + } + ] + ], + "title": "Test Level", + "width": 5, + "height": 5 +} diff --git a/assets/shaders/tile_shader.wgsl b/assets/shaders/tile_shader.wgsl index 2f3fe01..d5b1965 100644 --- a/assets/shaders/tile_shader.wgsl +++ b/assets/shaders/tile_shader.wgsl @@ -43,7 +43,7 @@ fn fragment( } - let world_position = in.world_position + vec4(settings.world_offset_and_wetness.xz, 0., 0.); + let world_position = in.world_position + vec4(settings.world_offset_and_wetness.xyz, 0.); var test_position : vec3 = world_position.xyz * 0.3; var overlay_1: f32 = simplex_noise_3d(test_position); diff --git a/src/game/board.rs b/src/game/board.rs index 06f7a0d..fcff044 100644 --- a/src/game/board.rs +++ b/src/game/board.rs @@ -32,10 +32,10 @@ impl Plugin for BoardPlugin { .add_system(animate_goal.run_in_state(AppState::InGame)) .add_system(process_selection_events.run_in_state(AppState::InGame)) .add_exit_system(AppState::InGame, clear_board); - // #[cfg(feature = "dev")] - // app.add_plugin(bevy_inspector_egui::quick::AssetInspectorPlugin::< - // TileMaterial, - // >::default()); + #[cfg(feature = "dev")] + app.add_plugin(bevy_inspector_egui::quick::AssetInspectorPlugin::< + TileMaterial, + >::default()); // .add_plugin(bevy_inspector_egui::quick::ResourceInspectorPlugin::< // BoardRuntimeAssets, // >::default()); @@ -419,13 +419,13 @@ fn setup_board_materials( }); let tile_offset_h_material = tile_materials.add(TileMaterial { settings: InkSettings { - world_offset: Vec4::new(0., 0.5, 0., 0.), + world_offset: Vec4::new(0., 0., 0.5, 0.), ..Default::default() }, }); let tile_offset_wh_material = tile_materials.add(TileMaterial { settings: InkSettings { - world_offset: Vec4::new(0.5, 0.5, 0., 0.), + world_offset: Vec4::new(0.5, 0., 0.5, 0.), ..Default::default() }, }); diff --git a/src/game/in_game_ui.rs b/src/game/in_game_ui.rs index 62ed935..1cb88a7 100644 --- a/src/game/in_game_ui.rs +++ b/src/game/in_game_ui.rs @@ -74,10 +74,14 @@ fn display_ui(mut commands: Commands, level: Res) { .style(ButtonStyle::Small); parent.div().padding(20.); if let Some(text) = &level.sidebar_text { - parent.div().opaque().size(Size::new(Val::Px(200.),Val::Auto)).with_children(|parent| { + parent + .div() + .opaque() + .size(Size::new(Val::Px(200.), Val::Auto)) + .with_children(|parent| { parent.text(text).size(15.); - }); - } + }); + } }); #[cfg(feature = "dev")]