Tilemaps can now load their own physics engines from map properties. The gravity for the arcade simulation is acting a little funny when populated from the map properties.

This commit is contained in:
2026-06-02 17:11:16 -04:00
parent 9fed59c4c8
commit 652ee4cdf3
7 changed files with 221 additions and 76 deletions

View File

@@ -2,8 +2,9 @@
#define _TILEMAP_H_
#include <limits.h>
#include "actor.h"
#include "staticstring.h"
#include <akgl/actor.h>
#include <akgl/staticstring.h>
#include <akgl/physics.h>
#include <jansson.h>
#define AKGL_TILEMAP_MAX_WIDTH 512
@@ -98,6 +99,10 @@ typedef struct {
float p_rate;
akgl_Tileset tilesets[AKGL_TILEMAP_MAX_TILESETS];
akgl_TilemapLayer layers[AKGL_TILEMAP_MAX_LAYERS];
// Different levels may have different physics.
bool use_own_physics;
akgl_PhysicsBackend physics;
} akgl_Tilemap;
akerr_ErrorContext AKERR_NOIGNORE *akgl_tilemap_load(char *fname, akgl_Tilemap *dest);