feat: add level schema and tilemap tests

- Introduced a JSON schema for game levels to validate level data structure.
- Added comprehensive tests for tilemap functionalities including collision resolution, tile type retrieval, and level loading.
- Enhanced the SyncSystem to manage remote state synchronization and interpolation for smoother gameplay.
- Implemented an AudioSystem with tests to ensure audio loading and playback functionality.
- Updated NetworkClient to support dynamic WebSocket URLs from environment variables.
- Added integration tests for matchmaking and network communication between clients.
- Improved RenderSystem to correctly render player nicknames above sprites.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-02 18:48:46 +02:00
parent 4ee2a0a159
commit a37eb14ba5
16 changed files with 3931 additions and 50 deletions
+72
View File
@@ -0,0 +1,72 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "LevelData",
"description": "Schema for Zamny Browser game levels",
"type": "object",
"properties": {
"width": {
"description": "Width of the level in tiles",
"type": "integer",
"minimum": 1
},
"height": {
"description": "Height of the level in tiles",
"type": "integer",
"minimum": 1
},
"tileSize": {
"description": "Size of each tile in pixels (e.g. 32)",
"type": "integer",
"minimum": 1
},
"tiles": {
"description": "Flat array of tile types (0=walkable, 1=wall, 2=water, 3=door)",
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 3
}
},
"spawnPoints": {
"description": "Locations where players can spawn",
"type": "array",
"items": {
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
}
},
"required": ["x", "y"]
}
},
"entities": {
"description": "Entities to spawn in the level (enemies, items, etc.)",
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"props": {
"type": "object",
"additionalProperties": true
}
},
"required": ["type", "x", "y"]
}
}
},
"required": ["width", "height", "tileSize", "tiles"]
}