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.1.tar.gz (83.7 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.1-py3-none-any.whl (61.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tilemap_parser-3.1.1.tar.gz
Algorithm Hash digest
SHA256 3b322f5443841c726957b7cc84f998f1b4e4d9e9aa760f2cbdb35394d20635ab
MD5 18d903945abd247484a35d2ed951f3e4
BLAKE2b-256 7b54683beaa19d50e70acee9dbad06f23f7b7d89d77b45804e36a93c993dfddb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tilemap_parser-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5ba39ff0781f904b401a25a66087882073a67bd1d26c404cd6edad3333fd0d9
MD5 86c795f94deaa1d9a1abef269ab2d2ff
BLAKE2b-256 918cd7ce7b92355b1a1d5fa1a12dd0cc9a3d1a6f04f6a806fd8e9fbee857e43c

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