Well, I'm still having trouble with this, so I thought I would bump this thread instead of making a new one. Here's the code I'm using:
In the method that checks if the character is colliding with the floor
if (Frame.dir>=0){
tiley=Level.tile.get(f).y;
isTouchingFloor=true;
y=slopetemp;
return false;
}
if (Frame.dir<0){
//y=slopetemp;
return false;
}
if (Frame.dir==0){
//y=slopetemp;
return true;
}
and the one for walls
if (Frame.dir>0){
slopex=Level.tile.get(g).x;
System.out.println(slopex);
//slopey=y;
System.out.println(x+16);
slopetemp=y-(x+16-slopex);
//System.out.println(slopetemp);
y=slopetemp;
return false;
}
if (Frame.dir<0){
slopex=Level.tile.get(g).x;
//slopey=y;
//x-=Frame.dir;
//slopetemp=y+(x-slopex);
System.out.println(slopetemp);
//y+=Frame.dir;
return false;
}
if (Frame.dir==0){
}