diff --git a/examples/memory/main.rs b/examples/memory/main.rs index e5dfc151a3f..e74f567af79 100644 --- a/examples/memory/main.rs +++ b/examples/memory/main.rs @@ -32,8 +32,8 @@ pub fn main() { let main_window = MainWindow::new(); - let tile_options = main_window.get_tile_options(); - let mut tiles: Vec = tile_options.iter().chain(tile_options.iter()).collect(); + let initial_tiles = main_window.get_memory_tiles(); + let mut tiles: Vec = initial_tiles.iter().chain(initial_tiles.iter()).collect(); shuffle(&mut tiles); let tiles_model = Rc::new(VecModel::from(tiles)); diff --git a/examples/memory/memory.60 b/examples/memory/memory.60 index 24f023e53e7..1f0a1e1a028 100644 --- a/examples/memory/memory.60 +++ b/examples/memory/memory.60 @@ -85,7 +85,13 @@ export MainWindow := Window { signal check_if_pair_solved(); property disable_tiles; - property<[TileData]> tile_options: [ + property tile_size: 80px; + property tile_spacing: 10px; + + width: 4 * tile_size + 5 * tile_spacing; + height: 4 * tile_size + 5 * tile_spacing; + + property<[TileData]> memory_tiles : [ { image: img!"icons/at.png" }, { image: img!"icons/balance-scale.png" }, { image: img!"icons/bicycle.png" }, @@ -96,14 +102,6 @@ export MainWindow := Window { { image: img!"icons/video.png" }, ]; - property tile_size: 80px; - property tile_spacing: 10px; - - width: 4 * tile_size + 5 * tile_spacing; - height: 4 * tile_size + 5 * tile_spacing; - - property<[TileData]> memory_tiles; - for tile[i] in memory_tiles: MemoryTile { x: tile_spacing + mod(i, 4) * (tile_size + tile_spacing); y: tile_spacing + floor(i / 4) * (tile_size + tile_spacing);