Extra2D/examples/push_box/data.h

49 lines
972 B
C
Raw Normal View History

2026-02-11 19:40:26 +08:00
#pragma once
#define MAX_LEVEL 8
#define GAME_WIDTH 640.0f
#define GAME_HEIGHT 480.0f
2026-02-11 19:40:26 +08:00
namespace pushbox {
enum TYPE { Empty, Wall, Ground, Box, Man };
struct Piece {
TYPE type;
bool isPoint;
};
struct Map {
int width;
int height;
int roleX;
int roleY;
Piece value[12][12];
};
/**
* @brief -
* 使
*/
struct MoveRecord {
int fromX, fromY;
int toX, toY;
int boxFromX, boxFromY;
int boxToX, boxToY;
bool pushedBox;
MoveRecord() = default;
MoveRecord(int fx, int fy, int tx, int ty, bool pushed = false)
: fromX(fx), fromY(fy), toX(tx), toY(ty)
, boxFromX(-1), boxFromY(-1), boxToX(-1), boxToY(-1)
, pushedBox(pushed) {}
};
2026-02-11 19:40:26 +08:00
extern Map g_Maps[MAX_LEVEL];
extern int g_CurrentLevel;
extern bool g_SoundOpen;
extern int g_Direct;
extern bool g_Pushing;
} // namespace pushbox