tmx files can be seperated by layers if you use vectors it is very simple. I don't use 0's or 1's any more for collision detection sence I have my own editor. I have recieved emails to make my program available. I might make it availiable I just want to sell it not give it away. My editor does alot of tough stuff for me. Expessially when using tmx files. I am currently making 3d worlds with tmx files. which will be usefull for my next part of my editor. I am using loadsubimage to get images that will help in making a 3d game, but right know I am making a 2d game.
Any way this is how I implement jump. I use the tiled layer when is in a vector format and assign it group one. This following code assigns the 4th layer to group 1. If you look at the tiled file that is what I call the collision layer.
for(int ic=0;ic<numframes2list[4].size();ic++)
{
agk::SetSpritePhysicsOn(numframes2list[4][ic].spriteid,1);
agk::SetSpriteShape(numframes2list[4][ic].spriteid,3);
agk::SetSpriteShape(numframes2list[4][ic].spriteid,3);
agk::SetSpriteGroup(numframes2list[4][ic].spriteid,1);
}
....
if(mousey>agk::GetSpriteY(numframes.jump)&&mousey<agk::GetSpriteY(numframes.jump)+agk::GetSpriteWidth(numframes.jump)&&mousex>agk::GetSpriteX(numframes.jump)&&mousex<agk::GetSpriteX(numframes.jump)+agk::GetSpriteWidth(numframes.jump)&&agk::GetSpritePhysicsVelocityY(numframes.jump)>-1&&agk::GetSpritePhysicsVelocityY(numframes.jump)<1||agk::GetRawKeyState(32)&&
agk::GetSpritePhysicsVelocityY(numframes.jump)>-1&&agk::GetSpritePhysicsVelocityY(numframes.jump)<1)
{
numframes.waittime=0;
numframes.playanimation=false;
//agk::Print("pressed");
if(agk::GetSpriteHitGroup(1,agk::GetSpriteX(numframes2.charid)+5,agk::GetSpriteY(numframes2.charid)+64)||agk::GetSpriteHitGroup(1,agk::GetSpriteX(numframes2.charid)+16,agk::GetSpriteY(numframes2.charid)+60)||
agk::GetSpriteHitGroup(1,agk::GetSpriteX(numframes2.charid)+59,agk::GetSpriteY(numframes2.charid)+64)||
agk::GetSpriteHitGroup(1,agk::GetSpriteX(numframes2.charid)+20,agk::GetSpriteY(numframes2.charid)+60)||
agk::GetSpriteHitGroup(6,agk::GetSpriteX(numframes2.charid)+5,agk::GetSpriteY(numframes2.charid)+64)||agk::GetSpriteHitGroup(6,agk::GetSpriteX(numframes2.charid)+16,agk::GetSpriteY(numframes2.charid)+60)||
agk::GetSpriteHitGroup(6,agk::GetSpriteX(numframes2.charid)+59,agk::GetSpriteY(numframes2.charid)+64)||
agk::GetSpriteHitGroup(6,agk::GetSpriteX(numframes2.charid)+20,agk::GetSpriteY(numframes2.charid)+60))
{
Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.