Ok, I wrote a quick test app in Tier1 to test left and right tilt on the PB.
Now, when I broadcast to the AGKPlayer on the PB, GetDirectionX() allows left and right tilting, yet if I convert to Tier2 I have to change it to GetDirectionY() to be able to tilt left and right. It's like GetDirectionX() and GetDirectionY() functions are reversed.
Has anyone come across this before?
I have SetOrientation(1,1,0,0) and g_bLandscape = true;
Tier 1 code:
// check input :)
if (GetDirectionX() < 0) and (viewOffsetX > 4)
viewOffsetX = viewOffsetX - 4
endif
if (GetDirectionX() > 0) and (viewOffsetX < 1024)
viewOffsetX = viewOffsetX + 4
endif
Tier 2 code:
// check tilt right
if ((agk::GetDirectionY() > ACCELDEADZONE) && (viewOffsetX > scrollspeed))
{
viewOffsetX -= scrollspeed;
}
// check tilt left
if ((agk::GetDirectionY() < -ACCELDEADZONE) && (viewOffsetX < agk::GetSpriteWidth(testmap) - agk::GetDeviceWidth() - scrollspeed))
{
viewOffsetX += scrollspeed;
}
agk::SetViewOffset(viewOffsetX, viewOffsetY);
Both sets of code above have exactly the same effect...
I may have done something wrong, but I can't see what,
Blackberry App Development & ZX Spectrum Game Development.