mima-engine 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mima_engine-0.3.0 → mima_engine-0.3.2}/PKG-INFO +1 -1
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/__init__.py +1 -1
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/geometry.py +67 -26
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/spatial.py +28 -5
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/sprite.py +3 -1
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/tiled_map.py +16 -2
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/transformed_view.py +6 -3
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/user_input.py +20 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/.gitignore +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/CHANGELOG +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/README.md +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/data/gfx/tilemap.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/data/gfx/tilemap_packed.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/data/propertytypes.json +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/data/sampleMap.tmx +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/data/sampleSheet.tsx +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/data/tilesets/sampleSheet.tsx +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/License.txt +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Preview.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Sample.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiled/sampleMap.tmx +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiled/sampleSheet.tsx +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tilemap/tilemap.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tilemap/tilemap_packed.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0000.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0001.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0002.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0003.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0004.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0005.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0006.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0007.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0008.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0009.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0010.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0011.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0012.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0013.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0014.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0015.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0016.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0017.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0018.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0019.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0020.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0021.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0022.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0023.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0024.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0025.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0026.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0027.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0028.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0029.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0030.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0031.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0032.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0033.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0034.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0035.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0036.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0037.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0038.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0039.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0040.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0041.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0042.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0043.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0044.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0045.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0046.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0047.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0048.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0049.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0050.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0051.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0052.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0053.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0054.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0055.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0056.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0057.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0058.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0059.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0060.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0061.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0062.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0063.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0064.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0065.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0066.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0067.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0068.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0069.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0070.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0071.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0072.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0073.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0074.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0075.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0076.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0077.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0078.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0079.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0080.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0081.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0082.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0083.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0084.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0085.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0086.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0087.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0088.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0089.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0090.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0091.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0092.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0093.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0094.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0095.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0096.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0097.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0098.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0099.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0100.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0101.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0102.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0103.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0104.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0105.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0106.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0107.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0108.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0109.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0110.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0111.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0112.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0113.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0114.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0115.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0116.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0117.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0118.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0119.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0120.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0121.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0122.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0123.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0124.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0125.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0126.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0127.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0128.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0129.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0130.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tiles/tile_0131.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tilesheet.txt +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Visit Kenney.url +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Visit Patreon.url +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon.zip +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/mima_config.ini +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/mima_log.json +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/pyproject.toml +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/advanced/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/advanced/assets.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/advanced/scene.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/advanced/shape.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/advanced/shaped_sprite.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/pygame_assets.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/pygame_audio.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/pygame_backend.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/pygame_camera.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/pygame_events.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/touch_control_scheme_a.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/backend/touch_control_scheme_b.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/core/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/core/collision.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/core/database.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/core/engine.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/core/mode_engine.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/core/scene_engine.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/template.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tile.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tile_animation.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tile_info.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tile_layer.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/tiled_layer.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/tiled_map.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/tiled_object.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/tiled_objectgroup.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/tiled_template.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/tiled_tile.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tiled/tiled_tileset.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tilemap.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tileset.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/tileset_info.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/maps/transition_map.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/animated_sprite.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/attribute_effect.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/attributes.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/creature.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/dynamic.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/effects/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/effects/colorize_screen.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/effects/debug_box.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/effects/light.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/effects/show_sprite.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/effects/walking_on_grass.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/effects/walking_on_water.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/loader.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/projectile.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/sprite.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/color_gate.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/color_switch.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/container.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/floor_switch.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/gate.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/light_source.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/logic_gate.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/movable.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/oneway.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/pickup.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/switch.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/objects/world/teleport.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/py.typed +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/command.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/add_quest.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/change_map.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/close_dialog.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/equip_weapon.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/give_item.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/give_resource.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/move_map.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/move_to.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/oneway_move.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/parallel.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/play_sound.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/present_item.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/progress_quest.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/quit_game.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/save_game.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/screen_fade.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/serial.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/set_facing_direction.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/set_spawn_map.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/show_choices.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/show_dialog.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/commands/take_coins.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/scripts/script_processor.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/camera.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/multicolumn_list.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/pixel_font.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/standalone/scripting.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/states/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/states/game_state.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/states/memory.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/states/quest.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/alignment.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/blend.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/damage.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/direction.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/gate_color.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/graphic_state.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/keys.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/mode.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/nature.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/object.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/player.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/position.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/start.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/terrain.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/tile_collision.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/weapon_slot.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/types/window.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/usables/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/usables/item.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/usables/weapon.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/colors.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/constants.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/functions.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/input_defaults.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/logging.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/property.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/runtime_config.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/util/trading_item.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/view/__init__.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/view/camera.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/view/mima_mode.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/view/mima_scene.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/view/mima_view.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/src/mima/view/mima_window.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/assets.txt +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/healing_dragon_color.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/icon.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/norana-sheet.png +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/norana-sheet.tsx +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/test.tiled-project +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/test_map.tmx +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/fixtures/test_template.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/system/test_engine.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/system/test_map.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/system/test_ttv_with_map.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/system/test_two_players.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/system/test_window_manager.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/unit/test_multicolumn_list.py +0 -0
- {mima_engine-0.3.0 → mima_engine-0.3.2}/tests/unit/test_shape_collection.py +0 -0
|
@@ -1224,49 +1224,90 @@ def _circle_collides_with_line(
|
|
|
1224
1224
|
def _circle_collides_with_rect(
|
|
1225
1225
|
c: Circle, r: Rect, move_both: bool = False
|
|
1226
1226
|
) -> tuple[Vector2, Vector2]:
|
|
1227
|
-
closest_point = closest(r, c)
|
|
1228
|
-
ray = closest_point - c.pos
|
|
1229
|
-
overlap = c.radius - ray.magnitude()
|
|
1230
|
-
# TODO: std::isnan(overlap): overlap=0
|
|
1231
1227
|
new_pos1 = Vector2(c.pos.x, c.pos.y)
|
|
1232
1228
|
new_pos2 = Vector2(r.pos.x, r.pos.y)
|
|
1233
|
-
try:
|
|
1234
|
-
ray.normalize()
|
|
1235
|
-
except ValueError:
|
|
1236
|
-
# breakpoint()
|
|
1237
|
-
overlap = 0
|
|
1238
1229
|
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1230
|
+
closest_point = closest(r, c)
|
|
1231
|
+
# ray = closest_point - c.pos
|
|
1232
|
+
# overlap = c.radius - ray.magnitude()
|
|
1233
|
+
# TODO: std::isnan(overlap): overlap=0
|
|
1234
|
+
# try:
|
|
1235
|
+
# ray.normalize()
|
|
1236
|
+
# except ValueError:
|
|
1237
|
+
# # breakpoint()
|
|
1238
|
+
# overlap = 0
|
|
1239
|
+
|
|
1240
|
+
# if overlap > 0:
|
|
1241
|
+
# if move_both:
|
|
1242
|
+
# new_pos1 -= ray.normalize() * overlap * 0.5
|
|
1243
|
+
# new_pos2 += ray.normalize() * overlap * 0.5
|
|
1244
|
+
# else:
|
|
1245
|
+
# new_pos1 -= ray.normalize() * overlap
|
|
1246
|
+
|
|
1247
|
+
delta = c.pos - closest_point
|
|
1248
|
+
dist_sq = delta.length_squared()
|
|
1249
|
+
if dist_sq == 0:
|
|
1250
|
+
dx = min(abs(c.pos.x - r.left().pos.x), abs(c.pos.x - r.right().pos.x))
|
|
1251
|
+
dy = min(abs(c.pos.y - r.top().pos.y), abs(c.pos.y - r.bottom().pos.y))
|
|
1252
|
+
if dx < dy:
|
|
1253
|
+
normal = Vector2(1, 0) if c.pos.x > r.middle().x else Vector2(-1, 0)
|
|
1243
1254
|
else:
|
|
1244
|
-
|
|
1255
|
+
normal = Vector2(0, 1) if c.pos.y > r.middle().y else Vector2(0, -1)
|
|
1256
|
+
distance = 0
|
|
1257
|
+
else:
|
|
1258
|
+
distance = math.sqrt(dist_sq)
|
|
1259
|
+
normal = delta / distance
|
|
1245
1260
|
|
|
1261
|
+
penetration = c.radius - distance
|
|
1262
|
+
if move_both:
|
|
1263
|
+
new_pos1 += normal * penetration * 0.5
|
|
1264
|
+
new_pos2 -= normal * penetration * 0.5
|
|
1265
|
+
else:
|
|
1266
|
+
new_pos1 += normal * penetration
|
|
1246
1267
|
return new_pos1, new_pos2
|
|
1247
1268
|
|
|
1248
1269
|
|
|
1249
1270
|
def _circle_collides_with_circle(
|
|
1250
1271
|
c1: Circle, c2: Circle, move_both: bool = False
|
|
1251
1272
|
) -> tuple[Vector2, Vector2]:
|
|
1252
|
-
distance = (c1.pos - c2.pos).magnitude()
|
|
1253
|
-
overlap = distance - c1.radius - c2.radius
|
|
1254
|
-
|
|
1255
1273
|
new_pos1 = Vector2(c1.pos.x, c1.pos.y)
|
|
1256
1274
|
new_pos2 = Vector2(c2.pos.x, c2.pos.y)
|
|
1257
|
-
offset = c1.pos - c2.pos
|
|
1258
1275
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1276
|
+
# distance = (c1.pos - c2.pos).magnitude()
|
|
1277
|
+
# overlap = distance - c1.radius - c2.radius
|
|
1278
|
+
|
|
1279
|
+
# offset = c1.pos - c2.pos
|
|
1280
|
+
|
|
1281
|
+
# if distance == 0:
|
|
1282
|
+
# offset = Vector2(overlap, overlap)
|
|
1283
|
+
# else:
|
|
1284
|
+
# offset *= overlap / distance
|
|
1285
|
+
|
|
1286
|
+
# if move_both:
|
|
1287
|
+
# new_pos1 -= offset * 0.5
|
|
1288
|
+
# new_pos2 += offset * 0.5
|
|
1289
|
+
# else:
|
|
1290
|
+
# new_pos1 -= offset
|
|
1291
|
+
delta = c1.pos - c2.pos
|
|
1292
|
+
dist_sq = delta.length_squared()
|
|
1293
|
+
|
|
1294
|
+
if dist_sq == 0:
|
|
1295
|
+
# Deterministic fallback
|
|
1296
|
+
normal = Vector2(1, 0) if id(c1) < id(c2) else Vector2(-1, 0)
|
|
1297
|
+
distance = 0
|
|
1261
1298
|
else:
|
|
1262
|
-
|
|
1299
|
+
distance = math.sqrt(dist_sq)
|
|
1300
|
+
normal = delta / distance
|
|
1301
|
+
|
|
1302
|
+
penetration = c1.radius + c2.radius - distance
|
|
1303
|
+
if penetration <= 0:
|
|
1304
|
+
return new_pos1, new_pos2
|
|
1263
1305
|
|
|
1264
1306
|
if move_both:
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
return new_pos1, new_pos2
|
|
1307
|
+
correction = normal * (penetration * 0.5)
|
|
1308
|
+
return new_pos1 + correction, new_pos2 - correction
|
|
1309
|
+
|
|
1310
|
+
return new_pos1 + normal * penetration, new_pos2
|
|
1270
1311
|
|
|
1271
1312
|
|
|
1272
1313
|
def vmax(val: Vector2, other: Vector2) -> Vector2:
|
|
@@ -21,18 +21,21 @@ class SpatialGrid(Generic[T]):
|
|
|
21
21
|
# i: [] for i in range(self._n_cols * self._n_rows)
|
|
22
22
|
# }
|
|
23
23
|
self._cells: list[list[T]] = [[] for _ in range(self._n_cols * self._n_rows)]
|
|
24
|
+
self._object_map: dict[T, int] = {}
|
|
24
25
|
self.n_objects = 0
|
|
25
26
|
|
|
26
27
|
def insert(self, obj: T, pos: Vector2) -> None:
|
|
27
28
|
"""Insert object at given position in the grid."""
|
|
28
29
|
idx = self.get_grid_index(pos)
|
|
29
30
|
self._cells[idx].append(obj)
|
|
31
|
+
self._object_map[obj] = idx
|
|
30
32
|
self.n_objects += 1
|
|
31
33
|
|
|
32
34
|
def remove(self, obj: T, pos: Vector2) -> None:
|
|
33
35
|
"""Remove object at given position from the grid."""
|
|
34
36
|
idx = self.get_grid_index(pos)
|
|
35
37
|
self._cells[idx].remove(obj)
|
|
38
|
+
self._object_map.pop(obj)
|
|
36
39
|
self.n_objects -= 1
|
|
37
40
|
|
|
38
41
|
def relocate(self, obj: T, old_pos: Vector2, new_pos: Vector2) -> None:
|
|
@@ -40,17 +43,22 @@ class SpatialGrid(Generic[T]):
|
|
|
40
43
|
if old_pos == new_pos:
|
|
41
44
|
return
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
old_idx_from_pos = self.get_grid_index(old_pos)
|
|
47
|
+
if (old_idx := self._object_map[obj]) != old_idx_from_pos:
|
|
48
|
+
LOG.error(
|
|
49
|
+
"Cell mismatch for object %s: saved index %d != %d",
|
|
50
|
+
str(obj),
|
|
51
|
+
self._object_map[obj],
|
|
52
|
+
old_idx,
|
|
53
|
+
)
|
|
44
54
|
new_idx = self.get_grid_index(new_pos)
|
|
45
55
|
|
|
46
56
|
if old_idx == new_idx:
|
|
47
57
|
return
|
|
48
58
|
|
|
49
|
-
self._cells[old_idx].remove(obj)
|
|
50
|
-
self._cells[new_idx].append(obj)
|
|
51
|
-
|
|
52
59
|
LOG.debug(
|
|
53
|
-
"
|
|
60
|
+
"%s moving from (%.1f, %.1f) (cell %d) to (%.1f, %.1f) (cell %d)",
|
|
61
|
+
str(obj),
|
|
54
62
|
old_pos.x,
|
|
55
63
|
old_pos.y,
|
|
56
64
|
old_idx,
|
|
@@ -59,6 +67,20 @@ class SpatialGrid(Generic[T]):
|
|
|
59
67
|
new_idx,
|
|
60
68
|
)
|
|
61
69
|
|
|
70
|
+
if old_idx < 0 or old_idx >= len(self._cells):
|
|
71
|
+
LOG.error(
|
|
72
|
+
"Old cell %d of object does not exist. Number of cells %d.",
|
|
73
|
+
old_idx,
|
|
74
|
+
len(self._cells),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
if obj not in self._cells[old_idx]:
|
|
78
|
+
LOG.error("Object %s not in cell %d", str(obj), old_idx)
|
|
79
|
+
|
|
80
|
+
self._cells[old_idx].remove(obj)
|
|
81
|
+
self._cells[new_idx].append(obj)
|
|
82
|
+
self._object_map[obj] = new_idx
|
|
83
|
+
|
|
62
84
|
def get_grid_index(self, pos: Vector2) -> int:
|
|
63
85
|
x, y = self.get_grid_coords(pos)
|
|
64
86
|
return x + y * self._n_cols
|
|
@@ -118,6 +140,7 @@ class SpatialGrid(Generic[T]):
|
|
|
118
140
|
|
|
119
141
|
def clear(self) -> None:
|
|
120
142
|
self._cells: list[list[T]] = [[] for _ in range(self._n_cols * self._n_rows)]
|
|
143
|
+
self._object_map = {}
|
|
121
144
|
self.n_objects = 0
|
|
122
145
|
|
|
123
146
|
|
|
@@ -19,6 +19,7 @@ class Renderer(Protocol):
|
|
|
19
19
|
src_size: Vector2 | None = None,
|
|
20
20
|
scale: float = 1.0,
|
|
21
21
|
angle: float = 0,
|
|
22
|
+
cache: bool = False,
|
|
22
23
|
special_flags: int = 0,
|
|
23
24
|
) -> None: ...
|
|
24
25
|
|
|
@@ -94,7 +95,7 @@ class AnimatedSprite(Generic[GS, D]):
|
|
|
94
95
|
|
|
95
96
|
return update_vals
|
|
96
97
|
|
|
97
|
-
def draw(self, pos: Vector2, ttv: Renderer) -> None:
|
|
98
|
+
def draw(self, pos: Vector2, ttv: Renderer, cache: bool = False) -> None:
|
|
98
99
|
if self._image is None:
|
|
99
100
|
return
|
|
100
101
|
|
|
@@ -104,6 +105,7 @@ class AnimatedSprite(Generic[GS, D]):
|
|
|
104
105
|
src_pos=self._src_pos,
|
|
105
106
|
src_size=self._src_size,
|
|
106
107
|
scale=self._scale,
|
|
108
|
+
cache=cache,
|
|
107
109
|
)
|
|
108
110
|
|
|
109
111
|
def reset(self) -> None:
|
|
@@ -82,6 +82,7 @@ class Renderer(Protocol):
|
|
|
82
82
|
src_size: Vector2 | None = None,
|
|
83
83
|
scale: float = 1.0,
|
|
84
84
|
angle: float = 0,
|
|
85
|
+
cache: bool = False,
|
|
85
86
|
special_flags: int = 0,
|
|
86
87
|
) -> None: ...
|
|
87
88
|
|
|
@@ -426,8 +427,8 @@ class TiledLayerRenderable:
|
|
|
426
427
|
self.duration: float = 1.0
|
|
427
428
|
self.pos: Vector2 = Vector2()
|
|
428
429
|
|
|
429
|
-
def draw(self, ttv: Renderer) -> None:
|
|
430
|
-
ttv.draw_surface(self.pos, self.image)
|
|
430
|
+
def draw(self, ttv: Renderer, cache: bool = False) -> None:
|
|
431
|
+
ttv.draw_surface(self.pos, self.image, cache=cache)
|
|
431
432
|
|
|
432
433
|
def get_pos(self) -> Vector2:
|
|
433
434
|
return self.pos
|
|
@@ -770,6 +771,19 @@ class TiledTilemap:
|
|
|
770
771
|
tiles.append(tile)
|
|
771
772
|
return tiles
|
|
772
773
|
|
|
774
|
+
def get_tiles_in_area(
|
|
775
|
+
self, pos: Vector2, area: Vector2, z: int = 0
|
|
776
|
+
) -> list[TiledTile]:
|
|
777
|
+
tiles = []
|
|
778
|
+
tl = vfloor(pos)
|
|
779
|
+
br = tl + vfloor(area.elementwise() + 1)
|
|
780
|
+
|
|
781
|
+
for y in range(int(tl.y), int(br.y)):
|
|
782
|
+
for x in range(int(tl.x), int(br.x)):
|
|
783
|
+
tiles.extend(self.get_tiles(x, y, z))
|
|
784
|
+
|
|
785
|
+
return tiles
|
|
786
|
+
|
|
773
787
|
def _collect_tile(self, layer: _TiledLayer, x: int, y: int) -> TiledTile | None:
|
|
774
788
|
tid = layer.get_index(x, y)
|
|
775
789
|
if tid <= 0:
|
|
@@ -208,8 +208,10 @@ class TransformedView:
|
|
|
208
208
|
pygame.draw.line(
|
|
209
209
|
surface=self._screen,
|
|
210
210
|
color=color,
|
|
211
|
-
start_pos=self.world_to_screen(pos1) + self._pos
|
|
212
|
-
|
|
211
|
+
start_pos=(self.world_to_screen(pos1) + self._pos).elementwise()
|
|
212
|
+
* self._pixel_scale,
|
|
213
|
+
end_pos=(self.world_to_screen(pos2) + self._pos).elementwise()
|
|
214
|
+
* self._pixel_scale,
|
|
213
215
|
width=width,
|
|
214
216
|
)
|
|
215
217
|
|
|
@@ -327,6 +329,7 @@ class TransformedView:
|
|
|
327
329
|
src_size: Vector2 | None = None,
|
|
328
330
|
scale: float = 1.0,
|
|
329
331
|
angle: float = 0,
|
|
332
|
+
cache: bool = False,
|
|
330
333
|
special_flags: int = 0,
|
|
331
334
|
) -> None:
|
|
332
335
|
src_size = src_size if src_size is not None else Vector2(surf.get_size())
|
|
@@ -365,7 +368,7 @@ class TransformedView:
|
|
|
365
368
|
int(src.get_height() * scaling_factor.y),
|
|
366
369
|
),
|
|
367
370
|
)
|
|
368
|
-
if self._cache_surfaces:
|
|
371
|
+
if self._cache_surfaces or cache:
|
|
369
372
|
self._cache[cache_key] = src
|
|
370
373
|
self._memory_usage += src.get_width() * src.get_height() * 4
|
|
371
374
|
LOG.debug(
|
|
@@ -6,6 +6,8 @@ import pygame
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Input(Enum):
|
|
9
|
+
"""Capture all possible inputs based on typical gamepad layouts."""
|
|
10
|
+
|
|
9
11
|
UP = 0
|
|
10
12
|
DOWN = 1
|
|
11
13
|
LEFT = 2
|
|
@@ -74,11 +76,24 @@ class InputManager:
|
|
|
74
76
|
self._inputs_schemes = []
|
|
75
77
|
|
|
76
78
|
def add_input_scheme(self, scheme: InputScheme) -> None:
|
|
79
|
+
"""Add an input scheme to this manager."""
|
|
77
80
|
self._inputs_schemes.append(scheme)
|
|
78
81
|
|
|
79
82
|
def process_events(
|
|
80
83
|
self, events: list[pygame.event.Event] | None = None
|
|
81
84
|
) -> list[pygame.event.Event]:
|
|
85
|
+
"""Query and process all pygame events that are relevant for input.
|
|
86
|
+
|
|
87
|
+
Events may be provided or queried directly from pygame. Processing of
|
|
88
|
+
events is delegated to the input schemes.
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
events: List of pygame events or None. When None is passed, the
|
|
92
|
+
inputs will be queried from ``pygame.event``.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
A list with all pygame events.
|
|
96
|
+
"""
|
|
82
97
|
if events is None or not events:
|
|
83
98
|
events = [e for e in pygame.event.get()]
|
|
84
99
|
|
|
@@ -95,24 +110,29 @@ class InputManager:
|
|
|
95
110
|
return events
|
|
96
111
|
|
|
97
112
|
def pressed(self, button: Input, player: Player = Player.P1) -> bool:
|
|
113
|
+
"""Return True when the requested input has been newly pressed."""
|
|
98
114
|
return (
|
|
99
115
|
self._new_keys[player][button] != 0 and self._last_keys[player][button] == 0
|
|
100
116
|
)
|
|
101
117
|
|
|
102
118
|
def held(self, button: Input, player: Player = Player.P1) -> bool:
|
|
119
|
+
"""Return True when the requested input has been held."""
|
|
103
120
|
return self._new_keys[player][button] != 0
|
|
104
121
|
|
|
105
122
|
def released(self, button: Input, player: Player = Player.P1) -> bool:
|
|
123
|
+
"""Return True when the requested input is no longer held."""
|
|
106
124
|
return (
|
|
107
125
|
self._last_keys[player][button] != 0 and self._new_keys[player][button] == 0
|
|
108
126
|
)
|
|
109
127
|
|
|
110
128
|
def get_value(self, button: Input, player: Player = Player.P1) -> float:
|
|
129
|
+
"""Return the value of the requested input."""
|
|
111
130
|
return self._new_keys[player][button]
|
|
112
131
|
|
|
113
132
|
def set_value(
|
|
114
133
|
self, value: float, button: Input, player: Player = Player.P1
|
|
115
134
|
) -> None:
|
|
135
|
+
"""Set the value for the requested input."""
|
|
116
136
|
self._new_keys[player][button] = value
|
|
117
137
|
|
|
118
138
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mima_engine-0.3.0 → mima_engine-0.3.2}/examples/kenney_tiny-dungeon/Tilemap/tilemap_packed.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|