Tiles are used like:
ACTOR NAME: ISO_FloorTile
Animation Names: Tile# , the number starts at 0 and goes up: 1, 2, 3, 4, .... 10, 20, 30... . 255 and up for now are considered unwalkable tiles. These are tiles that cannot be stepped on such as lava, water, walls, and other obstacles.
So the when listing the tiles should be like
Tile 255
Tile Name: Water
Notes: It's wet.
Tile256
Tile Name: Lava
Notes: Its hot.
Tile257
Tile Name: Acid
Notes: Very Acidy...
Try to name the images: Tile# , that way when adding them we just click add multiple files and boom they are all in.
The more generic the easy it will be to put it all together.
({Clean Copy))
Also anyone interested in the new global script:
- Code: Select all
//Structures
struct WorldNode;
struct Tile;
struct Object;
struct Creature;
typedef struct WorldNode{
double wn_GameX;
double wn_GameY;
int wn_NodeX;
int wn_NodeY;
int wn_NodeID;
struct Tile *wn_pTile;
struct FloatingTile *wn_pFTile;
struct Creature *wn_pCreature;
struct Object *wn_pObject;
struct WorldNode *wn_pPrevYNode;
struct WorldNode *wn_pNextYNode;
struct WorldNode *wn_pPrevXNode;
struct WorldNode *wn_pNextXNode;
}WorldNode;
typedef struct Tile{
int t_Anim;
int t_Unique;
char t_CloneName[32];
char t_Name[27];
struct WorldNode* t_pWorldNode;
struct Tile *t_pPrevY;
struct Tile *t_pNextY;
struct Tile *t_pPrevX;
struct Tile *t_pNextX;
}Tile;
typedef struct FloatingTile{
int ft_Unique;
int ft_Anim;
char ft_CloneName[32];
char ft_Name[27];
WorldNode* ft_pWorldNode;
}FloatingTile;
typedef struct Object{
int o_Anim;
char o_CloneName[32];
char o_Name[27];
WorldNode* o_pWorldNode;
} Object;
typedef struct Creature{
int cr_Anim;
char cr_CloneName[32];
char cr_Name[27];
WorldNode* cr_pWorldNode;
} Creature;
//IF YOU CHANGE MAPSIZE[] THEN YOU HAVE TO CHANGE cMAPSIZE TO EQUAL THAT AMOUNT IN TILES
//ALSO YOU HAVE TO EDIT YOUR MAP!!
const int g_SQVIEWMAPWIDTH = 5;
const int g_SQVIEWMAPHEIGHT = 5;
const int g_ISOVIEWMAPWIDTH = 35;
const int g_ISOVIEWMAPHEIGHT = 35;
const int g_SQTILESIZE[2] = {100, 100};
const int g_ISOTILESIZE[2] = {64, 32}; //size of each tile. W x H
const int g_UNREACHABLETILE = 255; //The start of the unwalkable tile animation
int g_MapHeight = 0;
int g_MapWidth = 0;
int g_MapSize = 0; //Amount of tiles to be created
int g_Move[4];
//2D Pointer Arrays for Structures
WorldNode *** g_WorldNodeList;
Tile *** g_TileList;
//2D array
int ** g_Map;
Tile *g_FirstTile, *g_LastTile;
Creature * g_Player;
//MISC variables
int g_TileClicked;
int g_Saved = 0;
int g_TextCloneCount = 0;
int g_ToggleGUI = 1;
int g_ToggleTP = 0;
int g_ToggleOP = 0;
int g_CurrentSelectedTile = 0;
int g_CurrentSelectedObject = 0;
int g_setTile = 0;
//Function Declarations
//MOVE VIEW
void MoveFloorRight(int VIEW_MH, int VIEW_MW);
void MoveFloorLeft(int VIEW_MH, int VIEW_MW);
void MoveFloorDown(int VIEW_MH, int VIEW_MW);
void MoveFloorUp(int VIEW_MH, int VIEW_MW);
//MAP CREATION
void CreateMap();
void CreateMapIso();
int GenerateMap(int VIEW_MH, int VIEW_MW);
void initalizeTile(Tile *pTile);
void initalizeWorldNode(WorldNode *pWorldNode);
void LinkWorldNodes();
void LinkTiles(int VIEW_MH, int VIEW_MW);
//MAP SCROLLING
void MoveTileToWorldNode(Tile *pTile, WorldNode *pWorldNode);
void UpdateTileActor(Tile* pTile);
void MovePlayerDown();
void MovePlayerUp();
void MovePlayerRight();
void MovePlayerLeft();
void LinkTile(Tile * pTile);
//MISC
int GetNodeIDFromXY(int x, int y);
int GetAIIDFromNode(int tID);
int GetAIIDFromXY(int x, int y);
void UpdateText(char string[40], int i);
void FreeMemory(int VIEW_MH, int VIEW_MW);
void PlaceTile(Actor* pTile, int nodeY,int nodeX);
Actor* getTileByNode(int node);
void MoveTileToArray(Actor* myActor);
//This is all the game data variables.
///////////////////////////////////////////////////////////////////////////////////////////////
//ALL FUNCTIONS BELOW
///////////////////////////////////////////////////////////////////////////////////////////////
void CreateMapIso()
{
int mh=0;
int mw=0;
int tX = 0;
int tY = 0;
int tNum = 0;
int tH = g_ISOTILESIZE[1];
int tW = g_ISOTILESIZE[0];
char tAnim[10];
Actor* myActor = 0;
g_FirstTile = g_TileList[0][0];
g_LastTile = g_TileList[g_ISOVIEWMAPHEIGHT-1][g_ISOVIEWMAPWIDTH-1];
for(mh = 0; mh < g_MapHeight; ++mh)
{
for(mw = 0; mw < g_MapWidth; ++mw)
{
tX = (tW/2 * mw)+ tW + (tW/2 * mh);
tY = (tH/2 * mh)-(tH/2 * mw);
g_WorldNodeList[mh][mw]->wn_GameX = tX;
g_WorldNodeList[mh][mw]->wn_GameY = tY;
g_WorldNodeList[mh][mw]->wn_NodeX = mw;
g_WorldNodeList[mh][mw]->wn_NodeY = mh;
g_WorldNodeList[mh][mw]->wn_NodeID = tNum;
tNum = tNum +1;
}
}
for(mh = 0; mh < g_ISOVIEWMAPHEIGHT; ++mh)
{
for(mw = 0; mw < g_ISOVIEWMAPWIDTH; ++mw)
{
tX = (tW/2 * mw)+ tW + (tW/2 * mh);
tY = (tH/2 * mh)-(tH/2 * mw);
sprintf(tAnim, "tile%i", g_Map[mh][mw]);
myActor = CreateActor("ISO_FloorTile", tAnim, "no parent", "no path", tX, tY, true);
strcpy(g_TileList[mh][mw]->t_Name, myActor->name);
strcpy(g_TileList[mh][mw]->t_CloneName, myActor->clonename);
g_TileList[mh][mw]->t_Anim = g_Map[mh][mw];
g_TileList[mh][mw]->t_pWorldNode = g_WorldNodeList[mh][mw];
g_WorldNodeList[mh][mw]->wn_pTile = g_TileList[mh][mw];
UpdateTileActor(g_TileList[mh][mw]);
}
}
LinkWorldNodes();
LinkTiles(g_ISOVIEWMAPHEIGHT, g_ISOVIEWMAPWIDTH);
myActor = CreateActor("MiddlePoint", "Pointer", "no parent", "no path", 0, 0, true);
strcpy(g_Player->cr_CloneName, myActor->clonename);
g_Player->cr_pWorldNode = g_WorldNodeList[g_ISOVIEWMAPHEIGHT/2][g_ISOVIEWMAPWIDTH/2];
myActor->x = g_Player->cr_pWorldNode->wn_GameX;
myActor->y = g_Player->cr_pWorldNode->wn_GameY -50;
//ChangeParent("view", "MiddlePoint");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void MoveFloorRight(int VIEW_MH, int VIEW_MW)
{
Tile *pTile = g_FirstTile;
Tile *tempTile;
int x;
int y;
int count = 0;
g_FirstTile = pTile->t_pNextX;
while(pTile != NULL)
{
tempTile = pTile->t_pNextY;
y = pTile->t_pWorldNode->wn_NodeY;
x = pTile->t_pWorldNode->wn_NodeX+VIEW_MW;
MoveTileToWorldNode(pTile, g_WorldNodeList[y][x]);
UpdateTileActor(pTile);
if(tempTile == NULL)
{
g_LastTile = pTile;
}
pTile = tempTile;
}
pTile = g_LastTile;
while(pTile != NULL)
{
LinkTile(pTile);
pTile = pTile->t_pPrevY;
}
}
void MoveFloorLeft(int VIEW_MH, int VIEW_MW)
{
Tile *pTile = g_LastTile;
Tile *tempTile;
int x;
int y;
g_LastTile = pTile->t_pPrevX;
while(pTile != NULL)
{
tempTile = pTile->t_pPrevY;
y = pTile->t_pWorldNode->wn_NodeY;
x = pTile->t_pWorldNode->wn_NodeX-VIEW_MW;
MoveTileToWorldNode(pTile, g_WorldNodeList[y][x]);
UpdateTileActor(pTile);
if(tempTile == NULL)
{
g_FirstTile = pTile;
}
pTile = tempTile;
}
pTile = g_FirstTile;
while(pTile != NULL)
{
LinkTile(pTile);
pTile = pTile->t_pNextY;
}
}
void MoveFloorDown(int VIEW_MH, int VIEW_MW)
{
Tile *pTile = g_FirstTile;
Tile *tempTile;
int x;
int y;
g_FirstTile = pTile->t_pNextY;
while(pTile != NULL)
{
tempTile = pTile->t_pNextX;
y = pTile->t_pWorldNode->wn_NodeY+VIEW_MH;
x = pTile->t_pWorldNode->wn_NodeX;
MoveTileToWorldNode(pTile, g_WorldNodeList[y][x]);
UpdateTileActor(pTile);
if(tempTile == NULL)
{
g_LastTile = pTile;
}
pTile = tempTile;
}
pTile = g_LastTile;
while(pTile != NULL)
{
LinkTile(pTile);
pTile = pTile->t_pPrevX;
}
}
void MoveFloorUp(int VIEW_MH, int VIEW_MW)
{
Tile *pTile = g_LastTile;
Tile *tempTile;
int x;
int y;
g_LastTile = pTile->t_pPrevY;
while(pTile != NULL)
{
tempTile = pTile->t_pPrevX;
y = pTile->t_pWorldNode->wn_NodeY-VIEW_MH;
x = pTile->t_pWorldNode->wn_NodeX;
MoveTileToWorldNode(pTile, g_WorldNodeList[y][x]);
UpdateTileActor(pTile);
if(tempTile == NULL)
{
g_FirstTile = pTile;
}
pTile = tempTile;
}
pTile = g_FirstTile;
while(pTile != NULL)
{
LinkTile(pTile);
pTile = pTile->t_pNextX;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
int GenerateMap(int VIEW_MH, int VIEW_MW)
{
int i;
int a;
if(!g_MapHeight || !g_MapWidth || g_MapSize)
{
return 1;
}
g_MapSize = g_MapHeight * g_MapWidth;
//Allocate memory for 2D array g_Map
g_Map = malloc(g_MapHeight * sizeof(int *));
if(g_Map == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
g_MapSize = 0;
return 1;
}
for(i = 0; i < g_MapHeight; i++)
{
g_Map[i] = malloc(g_MapWidth * sizeof(int));
if(g_Map[i] == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
g_MapSize = 0;
return 1;
}
}
//Allocate memory for 2D array g_WorldNodeList
g_WorldNodeList = malloc(g_MapHeight * sizeof(WorldNode **));
if(g_WorldNodeList == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
return 1;
}
for(i = 0; i < g_MapHeight; i++)
{
g_WorldNodeList[i] = malloc(g_MapWidth * sizeof(WorldNode*));
if(g_WorldNodeList[i] == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
return 1;
}
}
for(i = 0; i < g_MapHeight; i++)
{
for(a = 0; a < g_MapWidth; a++)
{
g_WorldNodeList[i][a] = (WorldNode *)malloc(sizeof(WorldNode));
if(g_WorldNodeList[i][a] == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
return 1;
}
initalizeWorldNode(g_WorldNodeList[i][a]);
}
}
//Allocate memory for 2D array g_TileList
g_TileList = malloc(VIEW_MH * sizeof(Tile **));
if(g_TileList == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
return 1;
}
for(i = 0; i < VIEW_MH; i++)
{
g_TileList[i] = malloc(VIEW_MW * sizeof(Tile*));
if(g_TileList[i] == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
return 1;
}
}
for(i = 0; i < VIEW_MH; i++)
{
for(a = 0; a < VIEW_MW; a++)
{
g_TileList[i][a] = (Tile *)malloc(sizeof(Tile));
if(g_TileList[i][a] == NULL)
{
UpdateText("ERROR: OUT OF MEMORY", 0);
return 1;
}
initalizeTile(g_TileList[i][a]);
}
}
g_Player = (Creature *)malloc(sizeof(Creature));
LinkWorldNodes();
LinkTiles(VIEW_MH, VIEW_MW);
UpdateText("GENERATED MAP, NUMBER OF TILES:", g_MapSize);
return 0; //If failed return 1; If completed return 0;
}
void FreeMemory(int VIEW_MH, int VIEW_MW)
{
int i;
int a;
for(i = 0; i < g_MapHeight; i++)
{
free(g_Map[i]);
}
for(i = 0; i < g_MapHeight; i++)
{
for(a = 0; a < g_MapWidth; a++)
{
free(g_WorldNodeList[i][a]);
}
free(g_WorldNodeList[i]);
}
for(i = 0; i < VIEW_MH; i++)
{
for(a = 0; a < VIEW_MW; a++)
{
free(g_TileList[i][a]);
}
free(g_TileList[i]);
}
free(g_Player);
free(g_TileList);
free(g_WorldNodeList);
free(g_Map);
UpdateText("Memory Freed", 0);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void UpdateText(char string[40], int i)
{
Actor* NewText;
Actor* OldText;
char buffer[20];
sprintf(buffer, "UPDATESTATUSTEXT.%i", g_TextCloneCount);
OldText = getclone(buffer);
++g_TextCloneCount;
NewText = CreateActor("UPDATESTATUSTEXT", "", "view", "no path", OldText->x, OldText->y+15, false);
if(!i)
{
strcpy(NewText->text, string);
}
else
{
sprintf(NewText->text, "%s %i", string, i);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void PlaceTile(Actor* pTile, int nodeY,int nodeX)
{
char tAnim[20];
sprintf(tAnim, "tile%i", g_CurrentSelectedTile );
ChangeAnimation(pTile->clonename,tAnim,NO_CHANGE);
if(nodeY != -1){ g_Map[nodeY][nodeX] = g_CurrentSelectedTile; }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void initalizeTile(Tile *pTile)
{
pTile->t_Anim = 0;
pTile->t_Unique = 0;
strcpy(pTile->t_CloneName,"\0");
strcpy(pTile->t_Name, "\0");
pTile->t_pWorldNode = NULL;
pTile->t_pPrevY = NULL;
pTile->t_pNextY = NULL;
pTile->t_pPrevX = NULL;
pTile->t_pNextX = NULL;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void initalizeWorldNode(WorldNode *pWorldNode)
{
pWorldNode->wn_GameX = 0;
pWorldNode->wn_GameY = 0;
pWorldNode->wn_NodeX = 0;
pWorldNode->wn_NodeY = 0;
pWorldNode->wn_NodeID = 0;
pWorldNode->wn_pTile = NULL;
pWorldNode->wn_pFTile = NULL;
pWorldNode->wn_pCreature = NULL;
pWorldNode->wn_pObject = NULL;
pWorldNode->wn_pPrevYNode = NULL;
pWorldNode->wn_pNextYNode = NULL;
pWorldNode->wn_pPrevXNode = NULL;
pWorldNode->wn_pNextXNode = NULL;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void UpdateTileActor(Tile* pTile)
{
char tAnim[10];
Actor* pActor = getclone(pTile->t_CloneName);
pActor->x = pTile->t_pWorldNode->wn_GameX;
pActor->y = pTile->t_pWorldNode->wn_GameY;
pActor->a_nX = pTile->t_pWorldNode->wn_NodeX;
pActor->a_nY = pTile->t_pWorldNode->wn_NodeY;
pActor->a_nID = pTile->t_pWorldNode->wn_NodeID;
sprintf(tAnim, "tile%i", pTile->t_Anim);
ChangeAnimation(pActor->clonename,tAnim,NO_CHANGE);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void LinkWorldNodes()
{
int h;
int w;
//WorldNodeList[Y][X]
for(h = 0; h < (g_MapHeight); h++)
{
for(w = 0; w < (g_MapWidth); w++)
{
if(h == 0)
{
g_WorldNodeList[h][w]->wn_pPrevYNode = NULL;
}
else
{
g_WorldNodeList[h][w]->wn_pPrevYNode = g_WorldNodeList[h-1][w];
}
if(h == g_MapHeight-1)
{
g_WorldNodeList[h][w]->wn_pNextYNode = NULL;
}
else
{
g_WorldNodeList[h][w]->wn_pNextYNode = g_WorldNodeList[h+1][w];
}
if(w == 0)
{
g_WorldNodeList[h][w]->wn_pPrevXNode = NULL;
}
else
{
g_WorldNodeList[h][w]->wn_pPrevXNode = g_WorldNodeList[h][w-1];
}
if(w == g_MapWidth-1)
{
g_WorldNodeList[h][w]->wn_pNextXNode = NULL;
}
else
{
g_WorldNodeList[h][w]->wn_pNextXNode = g_WorldNodeList[h][w+1];
}
}
}
É
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void LinkTiles(int VIEW_MH, int VIEW_MW)
{
int h;
int w;
//TileList[Y][X]
for(h = 0; h < (VIEW_MH); h++)
{
for(w = 0; w < (VIEW_MW); w++)
{
if(h == 0)
{
g_TileList[h][w]->t_pPrevY = NULL;
}
else
{
g_TileList[h][w]->t_pPrevY = g_TileList[h-1][w];
}
if(h == VIEW_MH-1)
{
g_TileList[h][w]->t_pNextY = NULL;
}
else
{
g_TileList[h][w]->t_pNextY = g_TileList[h+1][w];
}
if(w == 0)
{
g_TileList[h][w]->t_pPrevX = NULL;
}
else
{
g_TileList[h][w]->t_pPrevX = g_TileList[h][w-1];
}
if(w == VIEW_MW-1)
{
g_TileList[h][w]->t_pNextX = NULL;
}
else
{
g_TileList[h][w]->t_pNextX = g_TileList[h][w+1];
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void MoveTileToWorldNode(Tile *pTile, WorldNode *pWorldNode)
{
//Link Top and bottom Tiles together
if(pTile->t_pPrevY == NULL) // If the back tile doesn't exist
{ if(pTile->t_pNextY != NULL) // If the front tile Exists.
{ pTile->t_pNextY->t_pPrevY = NULL; } // The front tile's back Tile is NULL
//else do nothing
}
else // If the Back Tile Exists
{ if(pTile->t_pNextY == NULL) //If the Front Tile Doesn't Exist
{ pTile->t_pPrevY->t_pNextY = NULL; } // The back Tile's Front Tile is Null
else //If both Back and Front Tiles Exist
{
pTile->t_pPrevY->t_pNextY = pTile->t_pNextY; // The back tile points to the front tile
pTile->t_pNextY->t_pPrevY = pTile->t_pPrevY; // The front tile points to the back tile
}
}
//Link Back and Front Tiles Together
if(pTile->t_pPrevX == NULL)
{ if(pTile->t_pNextX != NULL)
{ pTile->t_pNextX->t_pPrevX = NULL; }
//else do nothing
}
else
{ if(pTile->t_pNextX == NULL)
{ pTile->t_pPrevX->t_pNextX = NULL; }
else
{
pTile->t_pPrevX->t_pNextX = pTile->t_pNextX;
pTile->t_pNextX->t_pPrevX = pTile->t_pPrevX;
}
}
//Unlink Tile from current WorldNode
pTile->t_pWorldNode->wn_pTile = NULL;
//Link the Tile to the new World Node
pTile->t_pWorldNode = pWorldNode;
pWorldNode->wn_pTile = pTile;
//Set the animation value
pTile->t_Anim = g_Map[pWorldNode->wn_NodeY][pWorldNode->wn_NodeX];
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void MovePlayerDown()
{
Actor* pActor = getclone(g_Player->cr_CloneName);
g_Player->cr_pWorldNode = g_Player->cr_pWorldNode->wn_pNextYNode;
pActor->x = g_Player->cr_pWorldNode->wn_GameX;
pActor->y = g_Player->cr_pWorldNode->wn_GameY - 50;
}
void MovePlayerUp()
{
Actor* pActor = getclone(g_Player->cr_CloneName);
g_Player->cr_pWorldNode = g_Player->cr_pWorldNode->wn_pPrevYNode;
pActor->x = g_Player->cr_pWorldNode->wn_GameX;
pActor->y = g_Player->cr_pWorldNode->wn_GameY - 50;
}
void MovePlayerRight()
{
Actor* pActor = getclone(g_Player->cr_CloneName);
g_Player->cr_pWorldNode = g_Player->cr_pWorldNode->wn_pNextXNode;
pActor->x = g_Player->cr_pWorldNode->wn_GameX;
pActor->y = g_Player->cr_pWorldNode->wn_GameY - 50;
}
void MovePlayerLeft()
{
Actor* pActor = getclone(g_Player->cr_CloneName);
g_Player->cr_pWorldNode = g_Player->cr_pWorldNode->wn_pPrevXNode;
pActor->x = g_Player->cr_pWorldNode->wn_GameX;
pActor->y = g_Player->cr_pWorldNode->wn_GameY - 50;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void LinkTile(Tile * pTile)
{
WorldNode * pWorldNode = pTile->t_pWorldNode;
if(pWorldNode->wn_pNextXNode != NULL)
{
if(pWorldNode->wn_pNextXNode->wn_pTile != NULL)
{
pTile->t_pNextX = pWorldNode->wn_pNextXNode->wn_pTile;
pWorldNode->wn_pNextXNode->wn_pTile->t_pPrevX = pTile;
}
else
{
pTile->t_pNextX = NULL;
}
}
else
{
pTile->t_pNextX = NULL;
}
if(pWorldNode->wn_pPrevXNode != NULL)
{
if(pWorldNode->wn_pPrevXNode->wn_pTile != NULL)
{
pTile->t_pPrevX = pWorldNode->wn_pPrevXNode->wn_pTile;
pWorldNode->wn_pPrevXNode->wn_pTile->t_pNextX = pTile;
}
else
{
pTile->t_pPrevX = NULL;
}
}
else
{
pTile->t_pPrevX = NULL;
}
if(pWorldNode->wn_pNextYNode != NULL)
{
if(pWorldNode->wn_pNextYNode->wn_pTile != NULL)
{
pTile->t_pNextY = pWorldNode->wn_pNextYNode->wn_pTile;
pWorldNode->wn_pNextYNode->wn_pTile->t_pPrevY = pTile;
}
else
{
pTile->t_pNextY = NULL;
}
}
else
{
pTile->t_pNextY = NULL;
}
if(pWorldNode->wn_pPrevYNode != NULL)
{
if(pWorldNode->wn_pPrevYNode->wn_pTile != NULL)
{
pTile->t_pPrevY = pWorldNode->wn_pPrevYNode->wn_pTile;
pWorldNode->wn_pPrevYNode->wn_pTile->t_pNextY = pTile;
}
else
{
pTile->t_pPrevY = NULL;
}
}
else
{
pTile->t_pPrevY = NULL;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void InitGame()
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//CREATED BY EVAN BLACK, 2011
// www.game-editor.com/forum USERNAME: EVANBLACK
Note: THE CODE ABOVE WORKS
I am trying to phase out the old arrays for linked lists and that means creating new functions to handle the lists and to move the tiles.
One of the issue I was trying to figure out was how to move the tiles across and I just figured it out. By having a pointer at the beginning and end of the tile list I can access the top left and bottom right corners. It seems natural enough that I would do that but I didn't think that by doing that I could have linear access to both sides without having conflicts at the corners, but I do. So I am going to get to work on doing that right away and quickly phasing out the old method which required more functions and more arrays.