JSON comments are back!

main
Johannes Hendrik Gerard van der Weide 2023-11-29 14:38:14 +01:00
parent 3609505057
commit c90fa73fb1
3 changed files with 4 additions and 2 deletions

View File

@ -6,4 +6,4 @@ edition = "2021"
[dependencies]
bevy = "0.12.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_json5 = "0.1.0"

View File

@ -1,6 +1,8 @@
{
//These values go hard feel free to modify tho
"speed":0.3,
"movement":[10.0,0.0],
//Stay the fuck away from these, please I worked very hard on them :(
"direction":[0.0,0.0],
"dash":false
}

View File

@ -37,7 +37,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let texture = asset_server.load("blobcat_hertog.png");
let json_file = fs::read_to_string("./data/player_data.json").expect("Error Reading Player Data");
let player_data: Player = serde_json::from_str::<Player>(&json_file).expect("Error serializing to JSON");
let player_data: Player = serde_json5::from_str::<Player>(&json_file).expect("Error serializing to JSON");
commands.spawn((
SpriteBundle {