The reason he flickers is because of how sideview gravity is coded. I might make a slight change in that regard. Otherwise, use this:
Code:
const float GRAVITY = 0.16;
// Use Slow Walk combos for the ladder.
ffc script SideviewLadder {
void run {
if (Screen->ComboT[ComboAt(Link->X, Link->Y+15)]==CT_WALKSLOW)
{
Link->Jump = GRAVITY; // Negate gravity
if (Link->InputUp && WalkableAt(Link->X+16, Link->Y+8) && WalkableAt(Link->X, Link->Y+8))
Link->Y-=1;
else if (Link->InputDown && WalkableAt(Link->X, Link->Y+16) && WalkableAt(Link->X+16, Link->Y+16))
Link->Y+=1;
if (WalkableAt(Link->X, Link->Y+16)) {
Link->InputA = false;
Link->InputB = false;
// Change tiles
}
}
}
}
You'll also need the WalkableAt method (or similar) defined somewhere.
Code:
// Determines whether a coordinate is walkable.
bool WalkableAt(int x, int y)
{
int x2 = Link->X % 16;
int y2 = Link->Y % 16;
int mask;
if (x2 >= 8)
mask = 1;
else
mask = 2;
if (y2 >= 8)
mask << 2;
return ((Screen->ComboS[ComboAt(x,y)] & mask)==0);
}
I might add WalkableAt to std.zh soon.