Hmm, this is what I currently came up with:
PHP Code:
function CheckForSlopes() {
if (this.vely != 0) return;
for (i=0;i<4;i+=1/16) {
if (tiles[playerx+1.5,playery+1.5+i] in this.left45) {
this.onslope = 1;
playery = int(playery+i)-((playerx+1.5)%1);
break;
}
}
if (i == 4) {
if (this.onslope == 1) playery = int(playery+(this.velx < 0 ? .5 : 0));
this.onslope = 0;
}
}