diff --git a/examples/the-dungeon-puzzlers-lament/build.rs b/examples/the-dungeon-puzzlers-lament/build.rs
index cb2b3e71..1561be13 100644
--- a/examples/the-dungeon-puzzlers-lament/build.rs
+++ b/examples/the-dungeon-puzzlers-lament/build.rs
@@ -9,21 +9,25 @@ use std::{
use proc_macro2::TokenStream;
const LEVEL_NAMES: &[&str] = &[
- "level1", "level2", "level3", "level4", "level5",
+ "level1",
+ "level2",
+ "level3",
+ "level4",
+ "level5",
"level6",
- // "level_switch",
- // "level_spikes",
- // "level_spikes2",
- // "squid_force_button",
- // "level_squid_intro",
- // "level_squid2",
- // "level_squid1",
- // "level_squid_item",
- // "level_squid_button",
- // "level_squid_drop",
- // "level_spikes3",
- // "level_around",
- // "level_squidprogramming",
+ "level_switch",
+ "level_spikes",
+ "level_spikes2",
+ "level_squid_force_button",
+ "level_squid_intro",
+ "level_squid2",
+ "level_squid1",
+ "level_squid_item",
+ "level_squid_button",
+ "level_squid_drop",
+ "level_spikes3",
+ "level_around",
+ "level_squidprogramming",
];
fn main() {
@@ -312,24 +316,24 @@ fn export_tiles(map: &tiled::Map, background: TokenStream) -> TokenStream {
match tile {
Some(tile) => {
- let vflip = tile.flip_h;
- let hflip = tile.flip_v;
+ let vflip = tile.flip_v;
+ let hflip = tile.flip_h;
+
+ // calculate the actual tile ID based on the properties here
+ // since the tiles in tiled are 16x16, but we want to export to 8x8, we have to work this out carefully
let tile_tileset_x = tile.id() % 9;
let tile_tileset_y = tile.id() / 9;
- let x_offset = if x % 2 == 0 && !hflip { 0 } else { 1 };
- let y_offset = if y % 2 == 0 && !vflip { 0 } else { 1 };
-
- // calculate the actual tile ID based on the properties here
- // since the tiles in tiled are 16x16, but we want to export to 8x8, we have to work this out carefully
+ let x_offset = if (x % 2 == 0) ^ hflip { 0 } else { 1 };
+ let y_offset = if (y % 2 == 0) ^ vflip { 0 } else { 1 };
let gba_tile_id =
tile_tileset_x * 2 + x_offset + tile_tileset_y * 9 * 4 + y_offset * 9 * 2;
let gba_tile_id = gba_tile_id as u16;
let palette_id =
quote! { backgrounds::#background.palette_assignments[#gba_tile_id as usize] };
- quote! { TileSetting::new(#gba_tile_id, #vflip, #hflip, #palette_id) }
+ quote! { TileSetting::new(#gba_tile_id, #hflip, #vflip, #palette_id) }
}
None => {
quote! { TileSetting::new(1023, false, false, 0) }
@@ -355,11 +359,11 @@ fn export_ui_tiles(map: &tiled::Map, background: TokenStream) -> TokenStream {
match tile {
Some(tile) => {
let tile_id = tile.id() as u16;
- let vflip = tile.flip_h;
- let hflip = tile.flip_v;
+ let vflip = tile.flip_v;
+ let hflip = tile.flip_h;
let palette_id =
quote! { backgrounds::#background.palette_assignments[#tile_id as usize] };
- quote! { TileSetting::new(#tile_id, #vflip, #hflip, #palette_id) }
+ quote! { TileSetting::new(#tile_id, #hflip, #vflip, #palette_id) }
}
None => {
quote! { TileSetting::new(1023, false, false, 0) }
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_around.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_around.tmx
new file mode 100644
index 00000000..a2e0cee9
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_around.tmx
@@ -0,0 +1,31 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes.tmx
new file mode 100644
index 00000000..d50168d9
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes.tmx
@@ -0,0 +1,40 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes2.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes2.tmx
new file mode 100644
index 00000000..f1e28c2f
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes2.tmx
@@ -0,0 +1,43 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes3.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes3.tmx
new file mode 100644
index 00000000..e8e67c6e
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_spikes3.tmx
@@ -0,0 +1,46 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid1.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid1.tmx
new file mode 100644
index 00000000..79dcfd30
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid1.tmx
@@ -0,0 +1,37 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid2.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid2.tmx
new file mode 100644
index 00000000..a740e0fc
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid2.tmx
@@ -0,0 +1,40 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_button.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_button.tmx
new file mode 100644
index 00000000..a6d7a077
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_button.tmx
@@ -0,0 +1,43 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_drop.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_drop.tmx
new file mode 100644
index 00000000..1dc5cabd
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_drop.tmx
@@ -0,0 +1,37 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_force_button.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_force_button.tmx
new file mode 100644
index 00000000..918dd3c5
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_force_button.tmx
@@ -0,0 +1,40 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_intro.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_intro.tmx
new file mode 100644
index 00000000..f16222ce
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_intro.tmx
@@ -0,0 +1,43 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_item.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_item.tmx
new file mode 100644
index 00000000..8c250cdb
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squid_item.tmx
@@ -0,0 +1,43 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squidprogramming.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squidprogramming.tmx
new file mode 100644
index 00000000..b7c12c53
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_squidprogramming.tmx
@@ -0,0 +1,52 @@
+
+
diff --git a/examples/the-dungeon-puzzlers-lament/maps/levels16/level_switch.tmx b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_switch.tmx
new file mode 100644
index 00000000..333cba05
--- /dev/null
+++ b/examples/the-dungeon-puzzlers-lament/maps/levels16/level_switch.tmx
@@ -0,0 +1,37 @@
+
+