Skip to main content

Standalone parser/loader for tilemap-editor JSON maps, sprite animations, and collision detection runtime.

Project description

tilemap-parser

Standalone parser/loader for tilemap-editor JSON maps, sprite animations, and collision detection runtime.

Features

  • Map parsing: Load and query tilemaps, layers, objects, and autotile data from JSON
  • Animation: Frame-based sprite animation with AnimationPlayer
  • Collision (tile-based): Polygon collision detection for tilemaps with slide, platformer, and RPG movement modes via CollisionRunner
  • Collision (object-to-object): Mixed-shape collision detection (rect, circle, capsule, polygon) with layer filtering via ObjectCollisionManager
  • Capsule support: Full capsule collision against all shape types
  • Hit helpers: CollisionHit.resolve(), involves(), other() for ergonomic separation

Quick Start

from tilemap_parser import load_map, TileLayerRenderer

game_data = load_map("path/to/map.json")
renderer = TileLayerRenderer(game_data)
from tilemap_parser import (
    CollisionRunner, CollisionCache,
    ObjectCollisionManager, CircleShape, RectangleShape,
)

# Tile-based collision
cache = CollisionCache()
tileset = cache.get_tileset_collision("data/collision/tileset.collision.json")
runner = CollisionRunner.from_game_type("topdown", tile_size=(32, 32))

# Object-to-object collision
manager = ObjectCollisionManager()
manager.add_object(player)
for hit in manager.check_all_collisions():
    hit.resolve()  # separate both objects

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tilemap_parser-3.1.7.tar.gz (85.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tilemap_parser-3.1.7-py3-none-any.whl (62.4 kB view details)

Uploaded Python 3

File details

Details for the file tilemap_parser-3.1.7.tar.gz.

File metadata

  • Download URL: tilemap_parser-3.1.7.tar.gz
  • Upload date:
  • Size: 85.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tilemap_parser-3.1.7.tar.gz
Algorithm Hash digest
SHA256 8d996a553c6b4be96f23c37e5de760ec343f322eb7b6dcdce6626fb8ee8d997a
MD5 05722fd051c07e34b09fd62529843e7a
BLAKE2b-256 86a0951efcbfb39e0887542e9024e8737d9d3c522213a4226559e277303b60a5

See more details on using hashes here.

File details

Details for the file tilemap_parser-3.1.7-py3-none-any.whl.

File metadata

  • Download URL: tilemap_parser-3.1.7-py3-none-any.whl
  • Upload date:
  • Size: 62.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for tilemap_parser-3.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e9cfe31d3d53cd337211b4600f9912914c8bae21d9fb9a15be654fdce9d3501e
MD5 e5a4ed4bcf8e2d1c7271c1dafa28551e
BLAKE2b-256 0b170afc65fd860c0deffa5e34b66c632ea07e1e6637d365d36914ff297fb0c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page