is it standard PSP behaviour with programming only that the analog stick tends to go left without reason (i guess not so here is the code) can someone tell me what i do wrong ?
Code: Select all
movement = (float)(pad.Lx)-128.0f;
if (movement < 20.0f && movement > -20.0f) { movement = 0.0f;}
else if (movement < 100.0f && movement > -100.0f) {
if (movement < 0) { movement = -0.01f;}
else { movement = 0.01f; }
}
else {
if (movement < 0) {movement = -0.025f;}
else { movement = 0.025f; }
}
player->setRoll(movement, player->rotation.y);
player->setDirection(VectorRotate(player->rotation.y));
as yo ucan see i check whether the value is beyond +20 or -20 to cure this problem for the most part but sometimes it still turns left automatically :S i can make the marge larger but then the death spot of the analog control gets to big i guess?
anyone got some solution ?