Hi...after exploding my brain i manage to do some loading to collision sprite based on CSV data from Tiled Editor coded as below
Im creating 5X5 32 pixel tilemap,and the creating second layer for collision but im using only the CSV data to draw tiles with collision values.(in the CSV 0 is collided,-1 is passable)
spr as integer
dim dummy as colbox
global colid //give id to dummy and give the count of dummy
columns=5 //should be known by level designer
rows=5//should be known by level designer
Dim map[rows,columns] //for storing data form text file
Dim dummysprite[99,99] //stupidly using 99
//1.reading collision data from text to 2 dimensional array and creaty sprite named Dummy
For y=1 to rows
For x=1 to columns
//create dummy sprite if map[y,x]=0
if map[y,x]=0 //if the data said 0 mean collidable(from tiled editor of course)
//=======Setting up player=============
For i=0 to colid
But im having THREE questions.
1.Although the collision tile drawn correctly as in tiled editor CSV, but collision wont happen.Can someone check and help my code?
2. Here i use colid to assign value to dummy (colbox type) to keep track on how many dummy have i created.
Any better way to keep track of this dummy?Notice that i set dim dummy as 99 in case i dont know how may collision tile have i made in the map, any better way todo this?
3.Are these method on the right path since i never tried 2d.