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.10.tar.gz (87.2 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.10-py3-none-any.whl (65.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tilemap_parser-3.1.10.tar.gz
  • Upload date:
  • Size: 87.2 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.10.tar.gz
Algorithm Hash digest
SHA256 2553fb6d3ed29df7ab68d6f90a98f4075713c1625009506a697c6844d21527a0
MD5 95f27d48584d6d7e5a6ea1205a379db7
BLAKE2b-256 8db092f703f5ba831de664b57584f9b1d3884096623d130dfab5f00ebe466d3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tilemap_parser-3.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 2d12e362b4b6ab1e11d47b41578ae552c943e5b9922ef64e198217d4c3227b91
MD5 807a7005d70a4374829b57be3801608c
BLAKE2b-256 b21b41446d50101f40dd254a845c46fd79138388a27a18580a5d2a89c884b54e

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