diff --git a/Cargo.lock b/Cargo.lock index a2efd4fcf26459b4876f8a015131820b049fbaed..375e4ce9b63069cdf508b7679dfcd135ecfe46e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2068,7 +2068,7 @@ dependencies = [ [[package]] name = "micro_ldtk" -version = "0.2.0" +version = "0.3.0-beta.1" dependencies = [ "anyhow", "bevy", diff --git a/src/assets/asset_events.rs b/src/assets/asset_events.rs index 1a561e57308984579ede97d313965043b09f1f9c..d71a094d80f0a798d402e62b871e01a95344bbb1 100644 --- a/src/assets/asset_events.rs +++ b/src/assets/asset_events.rs @@ -2,8 +2,9 @@ use std::collections::HashMap; use bevy::prelude::*; +use crate::assets::{LevelIndex, TileMetadata, TilesetIndex}; use crate::ldtk::Project; -use crate::{LdtkLevel, LevelDataUpdated, LevelIndex, TileMetadata, TilesetIndex}; +use crate::{LdtkLevel, LevelDataUpdated}; pub fn handle_ldtk_project_events( mut events: EventReader<AssetEvent<Project>>, @@ -17,10 +18,8 @@ pub fn handle_ldtk_project_events( AssetEvent::Created { handle } | AssetEvent::Modified { handle } => { if let Some(project) = assets.get(handle) { for level in &project.levels { - level_index.insert( - level.identifier.clone(), - LdtkLevel::from(level.serde_clone()), - ); + level_index + .insert(level.identifier.clone(), LdtkLevel::from(level.clone())); update_events.send(LevelDataUpdated(level.identifier.clone())); } diff --git a/src/assets/asset_storage.rs b/src/assets/asset_storage.rs index 8f820522814d69c4df1b006e728030e121bcdc03..3d2260e892420dcd431b61ac1b8d6496051d4929 100644 --- a/src/assets/asset_storage.rs +++ b/src/assets/asset_storage.rs @@ -2,6 +2,9 @@ use std::collections::HashMap; use std::ops::{Deref, DerefMut}; use bevy::prelude::Resource; +use serde_json::Value; + +use crate::LdtkLevel; #[derive(Resource, Default)] pub struct LevelIndex(pub HashMap<String, LdtkLevel>); diff --git a/src/camera.rs b/src/camera.rs index d54e3ddfd67446b6ab7c7a77a5b3847eea2f4c93..cb1b96d9d3e2652fd6f33eb27b3af0674b9c8071 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -14,8 +14,9 @@ pub fn lock_camera_to_level<CameraSelector: ReadOnlyWorldQuery>( }; for (mut transform, proj) in &mut camera_query { - let width = proj.right - proj.left; - let height = proj.top - proj.bottom; + let rect = proj.area; + let width = rect.width(); + let height = rect.height(); let val_x = bounds .get_min_x(width) @@ -24,9 +25,7 @@ pub fn lock_camera_to_level<CameraSelector: ReadOnlyWorldQuery>( .get_min_y(height) .max(bounds.get_max_y(height).min(transform.translation.y)); - // log::info!("BEFORE {:?}", transform.translation); transform.translation = Vec3::new(val_x, val_y, transform.translation.z); - // log::info!("AFTER {:?}", transform.translation); } } @@ -39,8 +38,9 @@ impl<'w, 's, Filter: ReadOnlyWorldQuery + 'static> CameraBounder<'w, 's, Filter> pub fn get_extremeties(&self) -> Option<Rect> { if let Some(bounds) = self.map_query.get_camera_bounds() { if let Ok(proj) = self.query.get_single() { - let width = proj.right - proj.left; - let height = proj.top - proj.bottom; + let rect = proj.area; + let width = rect.width(); + let height = rect.height(); Some(Rect::new( bounds.get_min_x(width), diff --git a/src/ldtk/mod.rs b/src/ldtk/mod.rs index d7c12de857ccf89ea7f4f1e81eb45349b1bda090..e217205d2444b641cd87caf57452da9cfe9494f6 100644 --- a/src/ldtk/mod.rs +++ b/src/ldtk/mod.rs @@ -11,10 +11,10 @@ pub use data_1_2_4::*; #[cfg(feature = "ldtk_1_2_5")] pub use data_1_2_5::*; -#[derive(thiserror::Error)] +#[derive(thiserror::Error, Debug)] pub enum ParseError { #[error("Failed to parse file: {0}")] - SerdeError(#[from] String), + SerdeError(String), } impl TypeUuid for Project { @@ -29,14 +29,6 @@ impl Project { pub type LdtkProject = Project; -impl<'a> TryFrom<&'a [u8]> for Project { - type Error = ParseError; - - fn try_from(value: &'a [u8]) -> Result<Self, Self::Error> { - Project::from_bytes(value) - } -} - impl<'a> From<&'a [u8]> for Project { fn from(value: &'a [u8]) -> Self { #[cfg(feature = "no_panic")] @@ -75,3 +67,18 @@ impl AssetLoader for LdtkLoader { &["ldtk"] } } + +#[cfg(test)] +mod test { + use crate::ldtk::Project; + + #[test] + pub fn load_project() { + const project_data: &[u8] = include_bytes!("./test_data/ver_1_2_5.ldtk"); + + let project = Project::from_bytes(project_data).expect("Failed to parse project file"); + for layer in project.defs.layers.iter() { + for auto_rule_group in layer.auto_rule_groups.iter() {} + } + } +} diff --git a/src/ldtk/test_data/ver_1_2_5.ldtk b/src/ldtk/test_data/ver_1_2_5.ldtk new file mode 100644 index 0000000000000000000000000000000000000000..6918e10192ec155aa3d126f583585e17019ee035 --- /dev/null +++ b/src/ldtk/test_data/ver_1_2_5.ldtk @@ -0,0 +1,652 @@ +{ + "__header__": { + "fileType": "LDtk Project JSON", + "app": "LDtk", + "doc": "https://ldtk.io/json", + "schema": "https://ldtk.io/files/JSON_SCHEMA.json", + "appAuthor": "Sebastien 'deepnight' Benard", + "appVersion": "1.2.5", + "url": "https://ldtk.io" + }, + "iid": "325092c0-c640-11ed-9e63-bd196e303d69", + "jsonVersion": "1.2.5", + "appBuildId": 464870, + "nextUid": 9, + "identifierStyle": "Capitalize", + "toc": [], + "worldLayout": "Free", + "worldGridWidth": 256, + "worldGridHeight": 256, + "defaultLevelWidth": 256, + "defaultLevelHeight": 256, + "defaultPivotX": 0, + "defaultPivotY": 0, + "defaultGridSize": 16, + "bgColor": "#40465B", + "defaultLevelBgColor": "#696A79", + "minifyJson": false, + "externalLevels": false, + "exportTiled": false, + "simplifiedExport": false, + "imageExportMode": "None", + "exportLevelBg": true, + "pngFilePattern": null, + "backupOnSave": false, + "backupLimit": 10, + "levelNamePattern": "Level_%idx", + "tutorialDesc": null, + "customCommands": [], + "flags": [], + "defs": { "layers": [ + { + "__type": "AutoLayer", + "identifier": "AutoLayer", + "type": "AutoLayer", + "uid": 5, + "doc": null, + "gridSize": 16, + "guideGridWid": 0, + "guideGridHei": 0, + "displayOpacity": 1, + "inactiveOpacity": 1, + "hideInList": false, + "hideFieldsWhenInactive": false, + "canSelectWhenInactive": true, + "pxOffsetX": 0, + "pxOffsetY": 0, + "parallaxFactorX": 0, + "parallaxFactorY": 0, + "parallaxScaling": true, + "requiredTags": [], + "excludedTags": [], + "intGridValues": [], + "autoRuleGroups": [{ "uid": 6, "name": "flloor", "active": true, "isOptional": false, "rules": [ + { + "uid": 8, + "active": true, + "size": 1, + "tileIds": [1], + "chance": 1, + "breakOnMatch": true, + "pattern": [2], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 5062337, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 7, + "active": true, + "size": 1, + "tileIds": [119], + "chance": 1, + "breakOnMatch": true, + "pattern": [1], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 1418109, + "perlinScale": 0.2, + "perlinOctaves": 2 + } + ], "usesWizard": false }], + "autoSourceLayerDefUid": 4, + "tilesetDefUid": 2, + "tilePivotX": 0, + "tilePivotY": 0 + }, + { + "__type": "IntGrid", + "identifier": "IntGrid", + "type": "IntGrid", + "uid": 4, + "doc": null, + "gridSize": 16, + "guideGridWid": 0, + "guideGridHei": 0, + "displayOpacity": 1, + "inactiveOpacity": 1, + "hideInList": false, + "hideFieldsWhenInactive": false, + "canSelectWhenInactive": true, + "pxOffsetX": 0, + "pxOffsetY": 0, + "parallaxFactorX": 0, + "parallaxFactorY": 0, + "parallaxScaling": true, + "requiredTags": [], + "excludedTags": [], + "intGridValues": [ { "value": 1, "identifier": "ground", "color": "#000000" }, { "value": 2, "identifier": "wall", "color": "#124E89" } ], + "autoRuleGroups": [], + "autoSourceLayerDefUid": null, + "tilesetDefUid": null, + "tilePivotX": 0, + "tilePivotY": 0 + }, + { + "__type": "Tiles", + "identifier": "Tiles2", + "type": "Tiles", + "uid": 3, + "doc": null, + "gridSize": 16, + "guideGridWid": 0, + "guideGridHei": 0, + "displayOpacity": 1, + "inactiveOpacity": 1, + "hideInList": false, + "hideFieldsWhenInactive": false, + "canSelectWhenInactive": true, + "pxOffsetX": 0, + "pxOffsetY": 0, + "parallaxFactorX": 0, + "parallaxFactorY": 0, + "parallaxScaling": true, + "requiredTags": [], + "excludedTags": [], + "intGridValues": [], + "autoRuleGroups": [], + "autoSourceLayerDefUid": null, + "tilesetDefUid": 2, + "tilePivotX": 0, + "tilePivotY": 0 + }, + { + "__type": "Tiles", + "identifier": "Tiles", + "type": "Tiles", + "uid": 1, + "doc": null, + "gridSize": 16, + "guideGridWid": 0, + "guideGridHei": 0, + "displayOpacity": 1, + "inactiveOpacity": 1, + "hideInList": false, + "hideFieldsWhenInactive": false, + "canSelectWhenInactive": true, + "pxOffsetX": 0, + "pxOffsetY": 0, + "parallaxFactorX": 0, + "parallaxFactorY": 0, + "parallaxScaling": true, + "requiredTags": [], + "excludedTags": [], + "intGridValues": [], + "autoRuleGroups": [], + "autoSourceLayerDefUid": null, + "tilesetDefUid": 2, + "tilePivotX": 0, + "tilePivotY": 0 + } + ], "entities": [], "tilesets": [ + { + "__cWid": 32, + "__cHei": 64, + "identifier": "Internal_Icons", + "uid": 2, + "relPath": null, + "embedAtlas": "LdtkIcons", + "pxWid": 512, + "pxHei": 1024, + "tileGridSize": 16, + "spacing": 0, + "padding": 0, + "tags": [], + "tagsSourceEnumUid": null, + "enumTags": [], + "customData": [], + "savedSelections": [], + "cachedPixelData": { + "opaqueTiles": "00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "averageColors": "00004b344233459b423349a959a9379c688769758ca4bc9489aab9aa58cc58bc42d74d2244ce428f4c7e4fb34abb45564ffe000000000000000000000000000069a969a97a99999999989a85998699767a7579667ccc7ccc7bcb7caa7ccc7ccc22d72d2224ce228f2c7e2fb32abb25562ffe000000000000000000000000000059764b97599868ac679a69ab4a84477756787688475347532a932a934a837a83f2b6fb22f3acf15afa6cfc93f899f334fccc000000000000000000000000000059aa49aa59996999699969aa489949995999799a499949992999299948997889a385a823a379a248a749a864a667a223a8880000000000000000000000000000189919991999199939994778166727772889289948993aaa389949a959a959a932b63b2233ad315a395c3c83389933343ccc00000000000000000000000000008aaa8aaa8aaa8aaa8aaa7bbb8aaa7bbb8bcb7aaa8bcb7bcb69aa8aaa8aaa69aa6abb6abb6abb6abb6a226a226a226a2261a661a661a661a600000000000000006c526c426c926c91659b649c66a566a46a7b6a7b667766776aba6abb676367636b746b746b746b74616c616c616c616c8abb8abb8abb8abb00000000000000006ba5579a6689598658875cb66abb9aa989aa98ac7abc6678968a88877c87cba952755823536952475648586354455223599900000000000000000000000000003ec63da76db79dc7554885498969b4377fa29e8289cdb9ce5ade5ade49ce49ce82a68a22839b8259885b8b73855683238aab00000000000000000000000000005d745d867da87e75448c458b86ad76ae68ac679c779b78ce3c9378867ca6adb7000000000000000000000000000000000000000000000000000000000000000057a668b899b8449396534493858364836853697769436667755667776c73498800000000000000000000000000000000000000000000000000000000000000006bba79b87d9679ad776a7b988abc8abc4aceaace4bba4bba6b8c4c9c4cac5b7c000000000000000000000000000000000000000000000000000000000000000059aaada7a9bdcdbd59aaada7a9bdcdbd8cb8a9b98ac889b8aabaacc79ea498bd000000000000000000000000000000000000000000000000000000000000000057ac596b55946abb5abb8ca65d8677ac437b5a3368886934547a595897a57b230000000000000000000000000000000000000000000000000000000000000000799a5c817b9b3a886abb8464676a7a967a857a857977898889882a954a956b950000000000000000000000000000000000000000000000000000000000000000499977997868799579875a6465995a8957a66a735ba53a935969479a576a467700000000000000000000000000000000000000000000000000000000000000005744985596659b747a659a76768a7a5676754777388735665976987794459465000000000000000000000000000000000000000000000000000000000000000088668a66868a9b8577666a4467846987778a7789797a87888b8676667a767ca50000000000000000000000000000000000000000000000000000000000000000449374934c957c9574847a438475a3958695768565956853b9447a777493a493000000000000000000000000000000000000000000000000000000000000000079547a838394689a49547a6357636975786383848997b384655873748974588400000000000000000000000000000000000000000000000000000000000000007da48ca769768b554b976cba3a824a82696259526a758c986963694268478b850000000000000000000000000000000000000000000000000000000000000000696559555579557458598674573353635677575579667a8758538b848a44838b0000000000000000000000000000000000000000000000000000000000000000385437883b95534549555a855877997598772b953b9529a939a95aa84b949a840000000000000000000000000000000000000000000000000000000000000000897687898776878578998485878b789a847b8b6579998a55886998788a879b9700000000000000000000000000000000000000000000000000000000000000006ba97988897469646b987a876a997a987b987955766777765c958a858777867700000000000000000000000000000000000000000000000000000000000000005a747b947b967866a855788928884566578879a98864a579233433343334633400000000000000000000000000000000000000000000000000000000000000006a747b846a844997598669987bb8b8aabaa96ba67cba9854687669864a864b86000000000000000000000000000000000000000000000000000000000000000038ab389b48ab47ac49ab48ac579b48ac49ab38ab58bc4b8659aa5c8457ac586a0000000000000000000000000000000000000000000000000000000000000000299b2999389a379b38893955589a79bc8c9588bc7a8c599a689a5b8558ac597a00000000000000000000000000000000000000000000000000000000000000002888378936773975579b389a579b488938884b74469a465747785b75568b586a000000000000000000000000000000000000000000000000000000000000000038553865285428444755566455763a64356746743779397445674c63469b585a0000000000000000000000000000000000000000000000000000000000000000284437643a7629641555297938874879385438664665355536775a85569a785a00000000000000000000000000000000000000000000000000000000000000005789789b779b6a75668a897b64558555876576798855845694749b74a68a986a000000000000000000000000000000000000000000000000000000000000000047776766678867667799798698768866976685673755387638763b74358b387a00000000000000000000000000000000000000000000000000000000000000005777686569874944498846774677685568646987677778775a456a65ab66ca550000000000000000000000000000000000000000000000000000000000000000355656666656455546455345634558655854aa749854775577737b64777a7a7900000000000000000000000000000000000000000000000000000000000000005955895598546c758c75ba76b88797749b75a98967888789978857888788a78800000000000000000000000000000000000000000000000000000000000000006977897799776a748a749a747987ba97aa998ba8a78bab75a87ab89cbb74b97b000000000000000000000000000000000000000000000000000000000000000059645788598858546a7569996a767a766887649c767476797a54766977667976000000000000000000000000000000000000000000000000000000000000000078887a75796577777a869976987799865777667787668a53857a885a98659546000000000000000000000000000000000000000000000000000000000000000087559877a96586779788b9769866888899877576777879647759a8659888a7440000000000000000000000000000000000000000000000000000000000000000785477887a55747b7585795b7999a9667456878889aa58997888797b56776855000000000000000000000000000000000000000000000000000000000000000048545854617b644557448744537b85565899899a39994a7a58998999a5558988000000000000000000000000000000000000000000000000000000000000000089659744a6559555a55698889486a57aab43a96b9556a665a854a579a744a5550000000000000000000000000000000000000000000000000000000000000000596587556677777777778578876687778974867787668876988897779876a744000000000000000000000000000000000000000000000000000000000000000067536556875448225922415851595456654587459456947b48997a86764585560000000000000000000000000000000000000000000000000000000000000000a854a89989998556a7559766a7779976a975997596749a64968a9779a55595450000000000000000000000000000000000000000000000000000000000000000674487549854885594558445a777a7778373579b5a32675584456975958b9944000000000000000000000000000000000000000000000000000000000000000077449754b674b469b964b658a766a864a777a975a566a754a677a875b777b9650000000000000000000000000000000000000000000000000000000000000000775577547445755676558744697377637766785334556566577859755877887600000000000000000000000000000000000000000000000000000000000000002789287328772a7436793a9457795a84368a3334323364555a757b856aaa9a5500000000000000000000000000000000000000000000000000000000000000005888516b5a3349a95964797778987a5375696a536668796577887a847a74797500000000000000000000000000000000000000000000000000000000000000007b537a53767b6769748775767a9a7988759c768a7b957a847775776478647854000000000000000000000000000000000000000000000000000000000000000098999788988998889b879a869a869a86696565676965667767446854677877880000000000000000000000000000000000000000000000000000000000000000678a77997ba647887a7589999ca59ba889aa9999655667bd6ba979a967bc6c7300000000000000000000000000000000000000000000000000000000000000006aaa6556518566775965485438985888576546854ca547775999699989997a9900000000000000000000000000000000000000000000000000000000000000006678526466335644769c5a7888547a785c4454a658885c946285627b6c54674a000000000000000000000000000000000000000000000000000000000000000033843b33359c337c395c3b853899355653745a33558b536b585b5a7557885445000000000000000000000000000000000000000000000000000000000000000026551566274525664a85486546564656377756664655465545454656516a656700000000000000000000000000000000000000000000000000000000000000004964696468553a86485437443645896588548856895477446a7569547a757954000000000000000000000000000000000000000000000000000000000000000036678566399988993b968b955ba658995566588859645a986ca7796477887ca6000000000000000000000000000000000000000000000000000000000000000019562a554c665c55156a256a468c557b1a8429744a845a83196b285a496b595b00000000000000000000000000000000000000000000000000000000000000001486248645a7549615782578469a5689187629764a875a861a692a694b7a5b79000000000000000000000000000000000000000000000000000000000000000017772777489858881555255546665556199528854884588411122112411251120000000000000000000000000000000000000000000000000000000000000000" + } + } + ], "enums": [], "externalEnums": [], "levelFields": [] }, + "levels": [ + { + "identifier": "Level_0", + "iid": "3250e0e0-c640-11ed-9e63-4fe123291067", + "uid": 0, + "worldX": 0, + "worldY": 0, + "worldDepth": 0, + "pxWid": 256, + "pxHei": 256, + "__bgColor": "#696A79", + "bgColor": null, + "useAutoIdentifier": true, + "bgRelPath": null, + "bgPos": null, + "bgPivotX": 0.5, + "bgPivotY": 0.5, + "__smartColor": "#ADADB5", + "__bgPos": null, + "externalRelPath": null, + "fieldInstances": [], + "layerInstances": [ + { + "__identifier": "AutoLayer", + "__type": "AutoLayer", + "__cWid": 16, + "__cHei": 16, + "__gridSize": 16, + "__opacity": 1, + "__pxTotalOffsetX": 0, + "__pxTotalOffsetY": 0, + "__tilesetDefUid": 2, + "__tilesetRelPath": null, + "iid": "69c86700-c640-11ed-9e63-f123596617e0", + "levelId": 0, + "layerDefUid": 5, + "pxOffsetX": 0, + "pxOffsetY": 0, + "visible": true, + "optionalRules": [], + "intGridCsv": [], + "autoLayerTiles": [ + { "px": [64,176], "src": [368,48], "f": 0, "t": 119, "d": [7,180] }, + { "px": [80,176], "src": [368,48], "f": 0, "t": 119, "d": [7,181] }, + { "px": [96,176], "src": [368,48], "f": 0, "t": 119, "d": [7,182] }, + { "px": [112,176], "src": [368,48], "f": 0, "t": 119, "d": [7,183] }, + { "px": [64,192], "src": [368,48], "f": 0, "t": 119, "d": [7,196] }, + { "px": [80,192], "src": [368,48], "f": 0, "t": 119, "d": [7,197] }, + { "px": [96,192], "src": [368,48], "f": 0, "t": 119, "d": [7,198] }, + { "px": [112,192], "src": [368,48], "f": 0, "t": 119, "d": [7,199] }, + { "px": [144,80], "src": [16,0], "f": 0, "t": 1, "d": [8,89] }, + { "px": [160,80], "src": [16,0], "f": 0, "t": 1, "d": [8,90] }, + { "px": [176,80], "src": [16,0], "f": 0, "t": 1, "d": [8,91] }, + { "px": [192,80], "src": [16,0], "f": 0, "t": 1, "d": [8,92] }, + { "px": [144,96], "src": [16,0], "f": 0, "t": 1, "d": [8,105] }, + { "px": [160,96], "src": [16,0], "f": 0, "t": 1, "d": [8,106] }, + { "px": [176,96], "src": [16,0], "f": 0, "t": 1, "d": [8,107] }, + { "px": [192,96], "src": [16,0], "f": 0, "t": 1, "d": [8,108] }, + { "px": [144,112], "src": [16,0], "f": 0, "t": 1, "d": [8,121] }, + { "px": [160,112], "src": [16,0], "f": 0, "t": 1, "d": [8,122] }, + { "px": [176,112], "src": [16,0], "f": 0, "t": 1, "d": [8,123] }, + { "px": [192,112], "src": [16,0], "f": 0, "t": 1, "d": [8,124] }, + { "px": [144,128], "src": [16,0], "f": 0, "t": 1, "d": [8,137] }, + { "px": [160,128], "src": [16,0], "f": 0, "t": 1, "d": [8,138] }, + { "px": [176,128], "src": [16,0], "f": 0, "t": 1, "d": [8,139] }, + { "px": [192,128], "src": [16,0], "f": 0, "t": 1, "d": [8,140] }, + { "px": [144,144], "src": [16,0], "f": 0, "t": 1, "d": [8,153] }, + { "px": [160,144], "src": [16,0], "f": 0, "t": 1, "d": [8,154] }, + { "px": [176,144], "src": [16,0], "f": 0, "t": 1, "d": [8,155] }, + { "px": [192,144], "src": [16,0], "f": 0, "t": 1, "d": [8,156] } + ], + "seed": 5669822, + "overrideTilesetUid": null, + "gridTiles": [], + "entityInstances": [] + }, + { + "__identifier": "IntGrid", + "__type": "IntGrid", + "__cWid": 16, + "__cHei": 16, + "__gridSize": 16, + "__opacity": 1, + "__pxTotalOffsetX": 0, + "__pxTotalOffsetY": 0, + "__tilesetDefUid": null, + "__tilesetRelPath": null, + "iid": "5d3ede60-c640-11ed-9e63-d74dccd7b2c2", + "levelId": 0, + "layerDefUid": 4, + "pxOffsetX": 0, + "pxOffsetY": 0, + "visible": true, + "optionalRules": [], + "intGridCsv": [ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0, + 2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2, + 2,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0 + ], + "autoLayerTiles": [], + "seed": 8359285, + "overrideTilesetUid": null, + "gridTiles": [], + "entityInstances": [] + }, + { + "__identifier": "Tiles2", + "__type": "Tiles", + "__cWid": 16, + "__cHei": 16, + "__gridSize": 16, + "__opacity": 1, + "__pxTotalOffsetX": 0, + "__pxTotalOffsetY": 0, + "__tilesetDefUid": 2, + "__tilesetRelPath": null, + "iid": "4d0bd5c0-c640-11ed-9e63-695c55c0b541", + "levelId": 0, + "layerDefUid": 3, + "pxOffsetX": 0, + "pxOffsetY": 0, + "visible": true, + "optionalRules": [], + "intGridCsv": [], + "autoLayerTiles": [], + "seed": 9316111, + "overrideTilesetUid": null, + "gridTiles": [ + { "px": [128,48], "src": [16,32], "f": 0, "t": 65, "d": [56] }, + { "px": [48,64], "src": [48,144], "f": 0, "t": 291, "d": [67] }, + { "px": [112,96], "src": [272,32], "f": 0, "t": 81, "d": [103] } + ], + "entityInstances": [] + }, + { + "__identifier": "Tiles", + "__type": "Tiles", + "__cWid": 16, + "__cHei": 16, + "__gridSize": 16, + "__opacity": 1, + "__pxTotalOffsetX": 0, + "__pxTotalOffsetY": 0, + "__tilesetDefUid": 2, + "__tilesetRelPath": null, + "iid": "36b65de0-c640-11ed-9e63-29b00a923bb6", + "levelId": 0, + "layerDefUid": 1, + "pxOffsetX": 0, + "pxOffsetY": 0, + "visible": true, + "optionalRules": [], + "intGridCsv": [], + "autoLayerTiles": [], + "seed": 3067355, + "overrideTilesetUid": null, + "gridTiles": [ + { "px": [0,0], "src": [256,0], "f": 0, "t": 16, "d": [0] }, + { "px": [16,0], "src": [256,0], "f": 0, "t": 16, "d": [1] }, + { "px": [32,0], "src": [256,0], "f": 0, "t": 16, "d": [2] }, + { "px": [48,0], "src": [256,0], "f": 0, "t": 16, "d": [3] }, + { "px": [64,0], "src": [256,0], "f": 0, "t": 16, "d": [4] }, + { "px": [80,0], "src": [256,0], "f": 0, "t": 16, "d": [5] }, + { "px": [96,0], "src": [256,0], "f": 0, "t": 16, "d": [6] }, + { "px": [112,0], "src": [256,0], "f": 0, "t": 16, "d": [7] }, + { "px": [128,0], "src": [256,0], "f": 0, "t": 16, "d": [8] }, + { "px": [144,0], "src": [256,0], "f": 0, "t": 16, "d": [9] }, + { "px": [160,0], "src": [256,0], "f": 0, "t": 16, "d": [10] }, + { "px": [176,0], "src": [256,0], "f": 0, "t": 16, "d": [11] }, + { "px": [192,0], "src": [256,0], "f": 0, "t": 16, "d": [12] }, + { "px": [208,0], "src": [256,0], "f": 0, "t": 16, "d": [13] }, + { "px": [224,0], "src": [256,0], "f": 0, "t": 16, "d": [14] }, + { "px": [240,0], "src": [256,0], "f": 0, "t": 16, "d": [15] }, + { "px": [0,16], "src": [256,0], "f": 0, "t": 16, "d": [16] }, + { "px": [16,16], "src": [256,0], "f": 0, "t": 16, "d": [17] }, + { "px": [32,16], "src": [256,0], "f": 0, "t": 16, "d": [18] }, + { "px": [48,16], "src": [256,0], "f": 0, "t": 16, "d": [19] }, + { "px": [64,16], "src": [256,0], "f": 0, "t": 16, "d": [20] }, + { "px": [80,16], "src": [256,0], "f": 0, "t": 16, "d": [21] }, + { "px": [96,16], "src": [256,0], "f": 0, "t": 16, "d": [22] }, + { "px": [112,16], "src": [256,0], "f": 0, "t": 16, "d": [23] }, + { "px": [128,16], "src": [256,0], "f": 0, "t": 16, "d": [24] }, + { "px": [144,16], "src": [256,0], "f": 0, "t": 16, "d": [25] }, + { "px": [160,16], "src": [256,0], "f": 0, "t": 16, "d": [26] }, + { "px": [176,16], "src": [256,0], "f": 0, "t": 16, "d": [27] }, + { "px": [192,16], "src": [256,0], "f": 0, "t": 16, "d": [28] }, + { "px": [208,16], "src": [256,0], "f": 0, "t": 16, "d": [29] }, + { "px": [224,16], "src": [256,0], "f": 0, "t": 16, "d": [30] }, + { "px": [240,16], "src": [256,0], "f": 0, "t": 16, "d": [31] }, + { "px": [0,32], "src": [256,0], "f": 0, "t": 16, "d": [32] }, + { "px": [16,32], "src": [256,0], "f": 0, "t": 16, "d": [33] }, + { "px": [32,32], "src": [256,0], "f": 0, "t": 16, "d": [34] }, + { "px": [48,32], "src": [256,0], "f": 0, "t": 16, "d": [35] }, + { "px": [64,32], "src": [256,0], "f": 0, "t": 16, "d": [36] }, + { "px": [80,32], "src": [256,0], "f": 0, "t": 16, "d": [37] }, + { "px": [96,32], "src": [256,0], "f": 0, "t": 16, "d": [38] }, + { "px": [112,32], "src": [256,0], "f": 0, "t": 16, "d": [39] }, + { "px": [128,32], "src": [256,0], "f": 0, "t": 16, "d": [40] }, + { "px": [144,32], "src": [256,0], "f": 0, "t": 16, "d": [41] }, + { "px": [160,32], "src": [256,0], "f": 0, "t": 16, "d": [42] }, + { "px": [176,32], "src": [256,0], "f": 0, "t": 16, "d": [43] }, + { "px": [192,32], "src": [256,0], "f": 0, "t": 16, "d": [44] }, + { "px": [208,32], "src": [256,0], "f": 0, "t": 16, "d": [45] }, + { "px": [224,32], "src": [256,0], "f": 0, "t": 16, "d": [46] }, + { "px": [240,32], "src": [256,0], "f": 0, "t": 16, "d": [47] }, + { "px": [0,48], "src": [256,0], "f": 0, "t": 16, "d": [48] }, + { "px": [16,48], "src": [256,0], "f": 0, "t": 16, "d": [49] }, + { "px": [32,48], "src": [272,0], "f": 0, "t": 17, "d": [50] }, + { "px": [48,48], "src": [272,0], "f": 0, "t": 17, "d": [51] }, + { "px": [64,48], "src": [272,0], "f": 0, "t": 17, "d": [52] }, + { "px": [80,48], "src": [256,0], "f": 0, "t": 16, "d": [53] }, + { "px": [96,48], "src": [256,0], "f": 0, "t": 16, "d": [54] }, + { "px": [112,48], "src": [256,0], "f": 0, "t": 16, "d": [55] }, + { "px": [128,48], "src": [256,0], "f": 0, "t": 16, "d": [56] }, + { "px": [144,48], "src": [256,0], "f": 0, "t": 16, "d": [57] }, + { "px": [160,48], "src": [256,0], "f": 0, "t": 16, "d": [58] }, + { "px": [176,48], "src": [256,0], "f": 0, "t": 16, "d": [59] }, + { "px": [192,48], "src": [256,0], "f": 0, "t": 16, "d": [60] }, + { "px": [208,48], "src": [256,0], "f": 0, "t": 16, "d": [61] }, + { "px": [224,48], "src": [256,0], "f": 0, "t": 16, "d": [62] }, + { "px": [240,48], "src": [256,0], "f": 0, "t": 16, "d": [63] }, + { "px": [0,64], "src": [256,0], "f": 0, "t": 16, "d": [64] }, + { "px": [16,64], "src": [256,0], "f": 0, "t": 16, "d": [65] }, + { "px": [32,64], "src": [272,0], "f": 0, "t": 17, "d": [66] }, + { "px": [48,64], "src": [272,0], "f": 0, "t": 17, "d": [67] }, + { "px": [64,64], "src": [272,0], "f": 0, "t": 17, "d": [68] }, + { "px": [80,64], "src": [256,0], "f": 0, "t": 16, "d": [69] }, + { "px": [96,64], "src": [256,0], "f": 0, "t": 16, "d": [70] }, + { "px": [112,64], "src": [256,0], "f": 0, "t": 16, "d": [71] }, + { "px": [128,64], "src": [256,0], "f": 0, "t": 16, "d": [72] }, + { "px": [144,64], "src": [256,0], "f": 0, "t": 16, "d": [73] }, + { "px": [160,64], "src": [256,0], "f": 0, "t": 16, "d": [74] }, + { "px": [176,64], "src": [256,0], "f": 0, "t": 16, "d": [75] }, + { "px": [192,64], "src": [256,0], "f": 0, "t": 16, "d": [76] }, + { "px": [208,64], "src": [256,0], "f": 0, "t": 16, "d": [77] }, + { "px": [224,64], "src": [256,0], "f": 0, "t": 16, "d": [78] }, + { "px": [240,64], "src": [256,0], "f": 0, "t": 16, "d": [79] }, + { "px": [0,80], "src": [256,0], "f": 0, "t": 16, "d": [80] }, + { "px": [16,80], "src": [256,0], "f": 0, "t": 16, "d": [81] }, + { "px": [32,80], "src": [272,0], "f": 0, "t": 17, "d": [82] }, + { "px": [48,80], "src": [272,0], "f": 0, "t": 17, "d": [83] }, + { "px": [64,80], "src": [272,0], "f": 0, "t": 17, "d": [84] }, + { "px": [80,80], "src": [256,0], "f": 0, "t": 16, "d": [85] }, + { "px": [96,80], "src": [256,0], "f": 0, "t": 16, "d": [86] }, + { "px": [112,80], "src": [256,0], "f": 0, "t": 16, "d": [87] }, + { "px": [128,80], "src": [256,0], "f": 0, "t": 16, "d": [88] }, + { "px": [144,80], "src": [256,0], "f": 0, "t": 16, "d": [89] }, + { "px": [160,80], "src": [256,0], "f": 0, "t": 16, "d": [90] }, + { "px": [176,80], "src": [256,0], "f": 0, "t": 16, "d": [91] }, + { "px": [192,80], "src": [256,0], "f": 0, "t": 16, "d": [92] }, + { "px": [208,80], "src": [256,0], "f": 0, "t": 16, "d": [93] }, + { "px": [224,80], "src": [256,0], "f": 0, "t": 16, "d": [94] }, + { "px": [240,80], "src": [256,0], "f": 0, "t": 16, "d": [95] }, + { "px": [0,96], "src": [256,0], "f": 0, "t": 16, "d": [96] }, + { "px": [16,96], "src": [256,0], "f": 0, "t": 16, "d": [97] }, + { "px": [32,96], "src": [256,0], "f": 0, "t": 16, "d": [98] }, + { "px": [48,96], "src": [256,0], "f": 0, "t": 16, "d": [99] }, + { "px": [64,96], "src": [256,0], "f": 0, "t": 16, "d": [100] }, + { "px": [80,96], "src": [256,0], "f": 0, "t": 16, "d": [101] }, + { "px": [96,96], "src": [256,0], "f": 0, "t": 16, "d": [102] }, + { "px": [112,96], "src": [256,0], "f": 0, "t": 16, "d": [103] }, + { "px": [128,96], "src": [256,0], "f": 0, "t": 16, "d": [104] }, + { "px": [144,96], "src": [256,0], "f": 0, "t": 16, "d": [105] }, + { "px": [160,96], "src": [256,0], "f": 0, "t": 16, "d": [106] }, + { "px": [176,96], "src": [256,0], "f": 0, "t": 16, "d": [107] }, + { "px": [192,96], "src": [256,0], "f": 0, "t": 16, "d": [108] }, + { "px": [208,96], "src": [256,0], "f": 0, "t": 16, "d": [109] }, + { "px": [224,96], "src": [256,0], "f": 0, "t": 16, "d": [110] }, + { "px": [240,96], "src": [256,0], "f": 0, "t": 16, "d": [111] }, + { "px": [0,112], "src": [256,0], "f": 0, "t": 16, "d": [112] }, + { "px": [16,112], "src": [256,0], "f": 0, "t": 16, "d": [113] }, + { "px": [32,112], "src": [256,0], "f": 0, "t": 16, "d": [114] }, + { "px": [48,112], "src": [256,0], "f": 0, "t": 16, "d": [115] }, + { "px": [64,112], "src": [256,0], "f": 0, "t": 16, "d": [116] }, + { "px": [80,112], "src": [256,0], "f": 0, "t": 16, "d": [117] }, + { "px": [96,112], "src": [256,0], "f": 0, "t": 16, "d": [118] }, + { "px": [112,112], "src": [256,0], "f": 0, "t": 16, "d": [119] }, + { "px": [128,112], "src": [256,0], "f": 0, "t": 16, "d": [120] }, + { "px": [144,112], "src": [256,0], "f": 0, "t": 16, "d": [121] }, + { "px": [160,112], "src": [256,0], "f": 0, "t": 16, "d": [122] }, + { "px": [176,112], "src": [256,0], "f": 0, "t": 16, "d": [123] }, + { "px": [192,112], "src": [256,0], "f": 0, "t": 16, "d": [124] }, + { "px": [208,112], "src": [256,0], "f": 0, "t": 16, "d": [125] }, + { "px": [224,112], "src": [256,0], "f": 0, "t": 16, "d": [126] }, + { "px": [240,112], "src": [256,0], "f": 0, "t": 16, "d": [127] }, + { "px": [0,128], "src": [256,0], "f": 0, "t": 16, "d": [128] }, + { "px": [16,128], "src": [256,0], "f": 0, "t": 16, "d": [129] }, + { "px": [32,128], "src": [256,0], "f": 0, "t": 16, "d": [130] }, + { "px": [48,128], "src": [256,0], "f": 0, "t": 16, "d": [131] }, + { "px": [64,128], "src": [256,0], "f": 0, "t": 16, "d": [132] }, + { "px": [80,128], "src": [256,0], "f": 0, "t": 16, "d": [133] }, + { "px": [96,128], "src": [256,0], "f": 0, "t": 16, "d": [134] }, + { "px": [112,128], "src": [256,0], "f": 0, "t": 16, "d": [135] }, + { "px": [128,128], "src": [256,0], "f": 0, "t": 16, "d": [136] }, + { "px": [144,128], "src": [256,0], "f": 0, "t": 16, "d": [137] }, + { "px": [160,128], "src": [256,0], "f": 0, "t": 16, "d": [138] }, + { "px": [176,128], "src": [256,0], "f": 0, "t": 16, "d": [139] }, + { "px": [192,128], "src": [256,0], "f": 0, "t": 16, "d": [140] }, + { "px": [208,128], "src": [256,0], "f": 0, "t": 16, "d": [141] }, + { "px": [224,128], "src": [256,0], "f": 0, "t": 16, "d": [142] }, + { "px": [240,128], "src": [256,0], "f": 0, "t": 16, "d": [143] }, + { "px": [0,144], "src": [256,0], "f": 0, "t": 16, "d": [144] }, + { "px": [16,144], "src": [256,0], "f": 0, "t": 16, "d": [145] }, + { "px": [32,144], "src": [256,0], "f": 0, "t": 16, "d": [146] }, + { "px": [48,144], "src": [256,0], "f": 0, "t": 16, "d": [147] }, + { "px": [64,144], "src": [256,0], "f": 0, "t": 16, "d": [148] }, + { "px": [80,144], "src": [256,0], "f": 0, "t": 16, "d": [149] }, + { "px": [96,144], "src": [256,0], "f": 0, "t": 16, "d": [150] }, + { "px": [112,144], "src": [256,0], "f": 0, "t": 16, "d": [151] }, + { "px": [128,144], "src": [256,0], "f": 0, "t": 16, "d": [152] }, + { "px": [144,144], "src": [256,0], "f": 0, "t": 16, "d": [153] }, + { "px": [160,144], "src": [256,0], "f": 0, "t": 16, "d": [154] }, + { "px": [176,144], "src": [256,0], "f": 0, "t": 16, "d": [155] }, + { "px": [192,144], "src": [256,0], "f": 0, "t": 16, "d": [156] }, + { "px": [208,144], "src": [256,0], "f": 0, "t": 16, "d": [157] }, + { "px": [224,144], "src": [256,0], "f": 0, "t": 16, "d": [158] }, + { "px": [240,144], "src": [256,0], "f": 0, "t": 16, "d": [159] }, + { "px": [0,160], "src": [256,0], "f": 0, "t": 16, "d": [160] }, + { "px": [16,160], "src": [256,0], "f": 0, "t": 16, "d": [161] }, + { "px": [32,160], "src": [256,0], "f": 0, "t": 16, "d": [162] }, + { "px": [48,160], "src": [256,0], "f": 0, "t": 16, "d": [163] }, + { "px": [64,160], "src": [256,0], "f": 0, "t": 16, "d": [164] }, + { "px": [80,160], "src": [256,0], "f": 0, "t": 16, "d": [165] }, + { "px": [96,160], "src": [256,0], "f": 0, "t": 16, "d": [166] }, + { "px": [112,160], "src": [256,0], "f": 0, "t": 16, "d": [167] }, + { "px": [128,160], "src": [256,0], "f": 0, "t": 16, "d": [168] }, + { "px": [144,160], "src": [256,0], "f": 0, "t": 16, "d": [169] }, + { "px": [160,160], "src": [256,0], "f": 0, "t": 16, "d": [170] }, + { "px": [176,160], "src": [256,0], "f": 0, "t": 16, "d": [171] }, + { "px": [192,160], "src": [256,0], "f": 0, "t": 16, "d": [172] }, + { "px": [208,160], "src": [256,0], "f": 0, "t": 16, "d": [173] }, + { "px": [224,160], "src": [256,0], "f": 0, "t": 16, "d": [174] }, + { "px": [240,160], "src": [256,0], "f": 0, "t": 16, "d": [175] }, + { "px": [0,176], "src": [256,0], "f": 0, "t": 16, "d": [176] }, + { "px": [16,176], "src": [256,0], "f": 0, "t": 16, "d": [177] }, + { "px": [32,176], "src": [256,0], "f": 0, "t": 16, "d": [178] }, + { "px": [48,176], "src": [256,0], "f": 0, "t": 16, "d": [179] }, + { "px": [64,176], "src": [256,0], "f": 0, "t": 16, "d": [180] }, + { "px": [80,176], "src": [256,0], "f": 0, "t": 16, "d": [181] }, + { "px": [96,176], "src": [256,0], "f": 0, "t": 16, "d": [182] }, + { "px": [112,176], "src": [256,0], "f": 0, "t": 16, "d": [183] }, + { "px": [128,176], "src": [256,0], "f": 0, "t": 16, "d": [184] }, + { "px": [144,176], "src": [256,0], "f": 0, "t": 16, "d": [185] }, + { "px": [160,176], "src": [256,0], "f": 0, "t": 16, "d": [186] }, + { "px": [176,176], "src": [256,0], "f": 0, "t": 16, "d": [187] }, + { "px": [192,176], "src": [256,0], "f": 0, "t": 16, "d": [188] }, + { "px": [208,176], "src": [256,0], "f": 0, "t": 16, "d": [189] }, + { "px": [224,176], "src": [256,0], "f": 0, "t": 16, "d": [190] }, + { "px": [240,176], "src": [256,0], "f": 0, "t": 16, "d": [191] }, + { "px": [0,192], "src": [256,0], "f": 0, "t": 16, "d": [192] }, + { "px": [16,192], "src": [256,0], "f": 0, "t": 16, "d": [193] }, + { "px": [32,192], "src": [256,0], "f": 0, "t": 16, "d": [194] }, + { "px": [48,192], "src": [256,0], "f": 0, "t": 16, "d": [195] }, + { "px": [64,192], "src": [256,0], "f": 0, "t": 16, "d": [196] }, + { "px": [80,192], "src": [256,0], "f": 0, "t": 16, "d": [197] }, + { "px": [96,192], "src": [256,0], "f": 0, "t": 16, "d": [198] }, + { "px": [112,192], "src": [256,0], "f": 0, "t": 16, "d": [199] }, + { "px": [128,192], "src": [256,0], "f": 0, "t": 16, "d": [200] }, + { "px": [144,192], "src": [256,0], "f": 0, "t": 16, "d": [201] }, + { "px": [160,192], "src": [256,0], "f": 0, "t": 16, "d": [202] }, + { "px": [176,192], "src": [256,0], "f": 0, "t": 16, "d": [203] }, + { "px": [192,192], "src": [256,0], "f": 0, "t": 16, "d": [204] }, + { "px": [208,192], "src": [256,0], "f": 0, "t": 16, "d": [205] }, + { "px": [224,192], "src": [256,0], "f": 0, "t": 16, "d": [206] }, + { "px": [240,192], "src": [256,0], "f": 0, "t": 16, "d": [207] }, + { "px": [0,208], "src": [256,0], "f": 0, "t": 16, "d": [208] }, + { "px": [16,208], "src": [256,0], "f": 0, "t": 16, "d": [209] }, + { "px": [32,208], "src": [256,0], "f": 0, "t": 16, "d": [210] }, + { "px": [48,208], "src": [256,0], "f": 0, "t": 16, "d": [211] }, + { "px": [64,208], "src": [256,0], "f": 0, "t": 16, "d": [212] }, + { "px": [80,208], "src": [256,0], "f": 0, "t": 16, "d": [213] }, + { "px": [96,208], "src": [256,0], "f": 0, "t": 16, "d": [214] }, + { "px": [112,208], "src": [256,0], "f": 0, "t": 16, "d": [215] }, + { "px": [128,208], "src": [256,0], "f": 0, "t": 16, "d": [216] }, + { "px": [144,208], "src": [256,0], "f": 0, "t": 16, "d": [217] }, + { "px": [160,208], "src": [256,0], "f": 0, "t": 16, "d": [218] }, + { "px": [176,208], "src": [256,0], "f": 0, "t": 16, "d": [219] }, + { "px": [192,208], "src": [256,0], "f": 0, "t": 16, "d": [220] }, + { "px": [208,208], "src": [256,0], "f": 0, "t": 16, "d": [221] }, + { "px": [224,208], "src": [256,0], "f": 0, "t": 16, "d": [222] }, + { "px": [240,208], "src": [256,0], "f": 0, "t": 16, "d": [223] }, + { "px": [0,224], "src": [256,0], "f": 0, "t": 16, "d": [224] }, + { "px": [16,224], "src": [256,0], "f": 0, "t": 16, "d": [225] }, + { "px": [32,224], "src": [256,0], "f": 0, "t": 16, "d": [226] }, + { "px": [48,224], "src": [256,0], "f": 0, "t": 16, "d": [227] }, + { "px": [64,224], "src": [256,0], "f": 0, "t": 16, "d": [228] }, + { "px": [80,224], "src": [256,0], "f": 0, "t": 16, "d": [229] }, + { "px": [96,224], "src": [256,0], "f": 0, "t": 16, "d": [230] }, + { "px": [112,224], "src": [256,0], "f": 0, "t": 16, "d": [231] }, + { "px": [128,224], "src": [256,0], "f": 0, "t": 16, "d": [232] }, + { "px": [144,224], "src": [256,0], "f": 0, "t": 16, "d": [233] }, + { "px": [160,224], "src": [256,0], "f": 0, "t": 16, "d": [234] }, + { "px": [176,224], "src": [256,0], "f": 0, "t": 16, "d": [235] }, + { "px": [192,224], "src": [256,0], "f": 0, "t": 16, "d": [236] }, + { "px": [208,224], "src": [256,0], "f": 0, "t": 16, "d": [237] }, + { "px": [224,224], "src": [256,0], "f": 0, "t": 16, "d": [238] }, + { "px": [240,224], "src": [256,0], "f": 0, "t": 16, "d": [239] }, + { "px": [0,240], "src": [256,0], "f": 0, "t": 16, "d": [240] }, + { "px": [16,240], "src": [256,0], "f": 0, "t": 16, "d": [241] }, + { "px": [32,240], "src": [256,0], "f": 0, "t": 16, "d": [242] }, + { "px": [48,240], "src": [256,0], "f": 0, "t": 16, "d": [243] }, + { "px": [64,240], "src": [256,0], "f": 0, "t": 16, "d": [244] }, + { "px": [80,240], "src": [256,0], "f": 0, "t": 16, "d": [245] }, + { "px": [96,240], "src": [256,0], "f": 0, "t": 16, "d": [246] }, + { "px": [112,240], "src": [256,0], "f": 0, "t": 16, "d": [247] }, + { "px": [128,240], "src": [256,0], "f": 0, "t": 16, "d": [248] }, + { "px": [144,240], "src": [256,0], "f": 0, "t": 16, "d": [249] }, + { "px": [160,240], "src": [256,0], "f": 0, "t": 16, "d": [250] }, + { "px": [176,240], "src": [256,0], "f": 0, "t": 16, "d": [251] }, + { "px": [192,240], "src": [256,0], "f": 0, "t": 16, "d": [252] }, + { "px": [208,240], "src": [256,0], "f": 0, "t": 16, "d": [253] }, + { "px": [224,240], "src": [256,0], "f": 0, "t": 16, "d": [254] }, + { "px": [240,240], "src": [256,0], "f": 0, "t": 16, "d": [255] } + ], + "entityInstances": [] + } + ], + "__neighbours": [] + } + ], + "worlds": [] +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 7bad7741847f4cacc49dc235c400bff152c0ca72..d1355c714b7f0d0efd4d7ab8bfba32f71ac7bd57 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,16 +25,15 @@ pub fn set_ldtk_tile_scale_f32(scale: f32) { mod __plugin { use std::marker::PhantomData; - use bevy::app::{App, CoreStage, Plugin}; - use bevy::asset::AddAsset; use bevy::ecs::query::ReadOnlyWorldQuery; + use bevy::prelude::*; pub struct MicroLDTKPlugin; impl Plugin for MicroLDTKPlugin { fn build(&self, app: &mut App) { #[cfg(any(feature = "ldtk_1_2_5", feature = "ldtk_1_2_4"))] { - app.add_event::<super::types::LevelDataUpdated>() + app.add_event::<super::system::LevelDataUpdated>() .add_asset::<super::ldtk::Project>() .add_asset_loader(super::ldtk::LdtkLoader) .init_resource::<super::assets::TilesetIndex>() @@ -66,9 +65,9 @@ mod __plugin { for MicroLDTKCameraPlugin<CameraFilter> { fn build(&self, app: &mut App) { - app.add_system_to_stage( - CoreStage::PostUpdate, - super::camera::lock_camera_to_level::<CameraFilter>, + app.add_system( + super::camera::lock_camera_to_level::<CameraFilter> + .in_base_set(CoreSet::PostUpdate), ); } } @@ -77,8 +76,9 @@ mod __plugin { use std::sync::atomic::{AtomicU32, Ordering}; pub use __plugin::{MicroLDTKCameraPlugin, MicroLDTKPlugin}; -pub use assets::{LdtkLoader, LdtkProject, LevelIndex, TileMetadata, TilesetIndex}; +pub use assets::{LevelIndex, TileMetadata, TilesetIndex}; pub use camera::CameraBounder; +pub use ldtk::{LdtkLoader, LdtkProject}; pub use map_query::{CameraBounds, MapQuery}; pub use pregen::{write_layer_to_texture, write_map_to_texture, Rasterise}; pub use system::*; diff --git a/src/map_query.rs b/src/map_query.rs index fe72d0c786b79adc381d5c5e9567cac76a23f0c4..e52ca283513913bdf97f69878ab4e2beda6f8720 100644 --- a/src/map_query.rs +++ b/src/map_query.rs @@ -7,7 +7,7 @@ use bevy::prelude::*; use crate::assets::LevelIndex; use crate::ldtk::EntityInstance; -use crate::utils::{ActiveLevel, SerdeClone}; +use crate::system::ActiveLevel; use crate::{get_ldtk_tile_scale, LdtkLayer, LdtkLevel}; #[derive(SystemParam)] @@ -149,13 +149,7 @@ impl<'w, 's> MapQuery<'w, 's> { pub fn get_owned_entities_of(level: &LdtkLevel) -> Vec<EntityInstance> { level .layers() - .flat_map(|layer| { - layer - .as_ref() - .entity_instances - .iter() - .map(|inst| inst.serde_clone()) - }) + .flat_map(|layer| layer.as_ref().entity_instances.iter().cloned()) .collect() } diff --git a/src/system/types.rs b/src/system/types.rs index 2b0d7f014bd9899b6697e8d0cddc4280357da0b7..50eac7e75f481d8911fc0edc5f6514c3b72c48a1 100644 --- a/src/system/types.rs +++ b/src/system/types.rs @@ -4,7 +4,6 @@ use std::ops::{Deref, DerefMut}; use std::path::Path; use bevy::math::{IVec2, Rect, UVec2, Vec2}; -use ldtk_rust::{EntityInstance, FieldInstance, LayerInstance, Level, TileInstance}; use num_traits::AsPrimitive; use quadtree_rs::area::{Area, AreaBuilder}; use quadtree_rs::point::Point; @@ -13,7 +12,7 @@ use serde::{Deserialize, Serialize}; use serde_json::{Map, Number, Value}; use crate::ldtk::{EntityInstance, FieldInstance, LayerInstance, Level, TileInstance}; -use crate::utils::{Indexer, SerdeClone}; +use crate::system::Indexer; use crate::{get_ldtk_tile_scale, px_to_grid, MapQuery}; #[derive(Default, Clone, Debug, Ord, PartialOrd, PartialEq, Eq)] @@ -255,7 +254,7 @@ impl LdtkLayer { let x = tile.px[0] / scale; let y = tile.px[1] / scale; - position_lookup.insert((x, y).into(), tile.serde_clone()); + position_lookup.insert((x, y).into(), tile.clone()); } Self {