1
const kseENTITY_MOVE = 1
2
const kseENTITY_NO_SPRITE = -1
9
dirUP = 4 //dUP conflicts with dup(licate)
12
struct typeEntityInstance {
14
string sName //alias (entity instance name); will be used for xxxLoop, xxxOnHit, xxxOnLoad, xxxOnUnload
15
int iObstructValue //when entity got obstructed, this will contain which area hit it.
16
int iEntityIdx //which is the parent entity
17
bool IsAttachedToMap //is instance attached to map?
27
int iSpriteIndex //holds the Image index which is the attached sprite fot this entity
28
//int iSpriteHandlers[10000]; //holds the array of frames
29
bool bHide; //should this entity be shown or not
32
bool bStatic; //if map is not moving player should not be animated walking
33
kseDIRECTION iDirection;
34
int iAnmt_UpCtr; //counts number of frames for MOVE-UP animation
35
//int iAnmt_UpTiles[10000]; //holds series of sprite tiles for MOVE-UP animation
36
int iAnmt_DownCtr; //counts number of frames for MOVE-DOWN animation
37
//int iAnmt_DownTiles[10000]; //holds series of sprite tiles for MOVE-DOWN animation
38
int iAnmt_LeftCtr; //counts number of frames for MOVE-LEFT animation
39
//int iAnmt_LeftTiles[10000]; //holds series of sprite tiles for MOVE-LEFT animation
40
int iAnmt_RightCtr; //counts number of frames for MOVE-RIGHT animation
41
//int iAnmt_RightTiles[10000]; //holds series of sprite tiles for MOVE-RIGHT animation
43
int *iSpriteHandlers; //holds the array of frames
44
int iSpriteHandlerMax; // for ubound
45
int *iAnmt_UpTiles; //holds series of sprite tiles for MOVE-UP animation
46
int iAnmt_UpTileMax; // for ubound
47
int *iAnmt_DownTiles; //holds series of sprite tiles for MOVE-DOWN animation
48
int iAnmt_DownTileMax; // for ubound
49
int *iAnmt_LeftTiles; //holds series of sprite tiles for MOVE-LEFT animation
50
int iAnmt_LeftTileMax; // for ubound
51
int *iAnmt_RightTiles; //holds series of sprite tiles for MOVE-RIGHT animation
52
int iAnmt_RightTileMax; // for ubound
54
bool IsAttachedToMap; //if attached to map
58
//struct typeEntitySprite {
59
// bool bStatic; 'animate or halt
60
// //int iDelay; 'how many times a frame will be showed; connected to animation
61
// int iCtr; 'animation counter
62
// int iIdx; 'would contain the index from an animation
65
struct typeSpriteAnimation {
67
int iCtr; //frame counter
68
//int iTiles[10000]; //will hold series of tiles for animation
70
int *iTiles //will hold series of tiles for animation
71
int iTileMax // for Ubound
74
extern vector<typeEntity> kseEntity;
75
extern vector<typeEntityInstance> kseEntityInstance;
76
//extern vector<typeEntitySprite> kseEntitySprites;
77
extern vector<typeSpriteAnimation> kseSpriteAnimation;
79
//extern int iEntityCtr;
80
//extern int iEntityInstanceCtr;
81
extern long int iEntitySpritesCtr;
82
extern long int iSpriteAnimationCtr;
85
int EntityAttachSprite(long int &iIndex);
86
int EntityDetachSprite(long int &iIndex);
87
int EntitySetX(long int &iIndex);
88
int EntitySetY(long int &iIndex);
89
int EntityGenerate(long int &iIndex);
90
int EntityNew(long int &iIndex);
91
int CreateNewEntity();
92
int EntityLoad(long int &iIndex);
93
void Engine_RunEntityScript(string flName, string fxName, string ksExt = ".ks");
94
int EntityUnload(long int &iIndex);
95
int EntitySetMoveUp(long int &iIndex);
96
int EntitySetMoveDown(long int &iIndex);
97
int EntitySetMoveLeft(long int &iIndex);
98
int EntitySetMoveRight(long int &iIndex);
99
void Engine_EntityChangeDirection(entity As Integer, kseDIRECTION dDir);
100
int Entity_SkipOpenParenthesisAfter(string sWhat, long int iIndex);
101
int Entity_SkipCommaAfter(string sWhat, long int iIndex);
102
int Entity_SkipCloseParenthesisAfter(string sWhat, long int iIndex);
104
int SynEntity(long int &iIndex);