This commit is contained in:
2025-06-08 17:22:30 +02:00
parent 64cac7578d
commit 79c8b747cd
16 changed files with 686 additions and 79 deletions

View File

@@ -8,8 +8,8 @@
#include "../util/util.h"
#include "../items/item.h"
#define MAP_WIDTH 1000
#define MAP_HEIGHT 1000
#define MAP_WIDTH 500
#define MAP_HEIGHT 500
#define DISPLAY_MAP_WIDTH 60
#define DISPLAY_MAP_HEIGHT 31
@@ -93,17 +93,19 @@ typedef struct TileTypeReg {
bool outputLane[ItemSlotCount];
bool needsTicks;
char startFrame;
bool walkable;
uint16_t maxHealth;
} TileTypeReg;
bool isWalkable(MiniRect tileCoords);
typedef struct BackgroundTileType {
ItemType type;
char name[20];
Animation animation;
bool walkable;
} BackgroundTileType;
typedef struct BackgroundTile {
BackgroundType type;
} BackgroundTile;
#define TILEREGISTRY_SIZE 64
@@ -115,6 +117,20 @@ void renderAllTiles(SDL_Renderer *renderer, SDL_Rect playerRect);
void updateTiles();
typedef struct PathFindDat {
int gCost;
int hCost;
struct PathFindDat* parent;
bool closed;
bool open;
uint32_t version;
} PathFindDat;
typedef struct BackgroundTile {
BackgroundType type;
PathFindDat pathFind;
} BackgroundTile;
typedef struct Tile {
OrientDirection direction;
ItemType type;
@@ -124,6 +140,8 @@ typedef struct Tile {
MiniRect rect;
int neededUpdateIndex;
char fixedFrame;
PathFindDat pathFind;
uint16_t health;
} Tile;