In original difficulty, no moving the camera on autoscrolling missions.

This commit is contained in:
onpon4 2015-05-20 10:27:21 -04:00
parent baab0e7897
commit 8698125f5f
1 changed files with 56 additions and 46 deletions

View File

@ -1234,64 +1234,74 @@ static void game_doPlayer()
if (engine.done == 0) if (engine.done == 0)
{ {
if (xmoved) if ((currentGame.difficulty != DIFFICULTY_ORIGINAL) ||
((currentGame.area != MISN_ELLESH) &&
(currentGame.area != MISN_MARS)))
{ {
if (player.x < xViewBorder) if (xmoved)
{ {
engine.smx += xViewBorder - player.x; if (player.x < xViewBorder)
player.x = xViewBorder; {
engine.smx += xViewBorder - player.x;
player.x = xViewBorder;
}
else if (player.x > screen->w - xViewBorder)
{
engine.smx += (screen->w - xViewBorder) - player.x;
player.x = screen->w - xViewBorder;
}
} }
else if (player.x > screen->w - xViewBorder) else if (currentGame.difficulty != DIFFICULTY_ORIGINAL)
{ {
engine.smx += (screen->w - xViewBorder) - player.x; cd = player.x - screen->w / 2;
player.x = screen->w - xViewBorder; if (cd < 0)
{
cc = MAX(cd / 10, MAX(0, engine.ssx) - cameraMaxSpeed);
player.x -= cc;
engine.smx -= cc;
}
else if (cd > 0)
{
cc = MIN(cd / 10, cameraMaxSpeed + MIN(0, engine.ssx));
player.x -= cc;
engine.smx -= cc;
}
} }
}
else if (currentGame.difficulty != DIFFICULTY_ORIGINAL)
{
cd = player.x - screen->w / 2;
if (cd < 0)
{
cc = MAX(cd / 10, MAX(0, engine.ssx) - cameraMaxSpeed);
player.x -= cc;
engine.smx -= cc;
}
else if (cd > 0)
{
cc = MIN(cd / 10, cameraMaxSpeed + MIN(0, engine.ssx));
player.x -= cc;
engine.smx -= cc;
}
}
if (ymoved) if (ymoved)
{
if (player.y < yViewBorder)
{ {
engine.smy += yViewBorder - player.y; if (player.y < yViewBorder)
player.y = yViewBorder; {
engine.smy += yViewBorder - player.y;
player.y = yViewBorder;
}
else if (player.y > screen->h - yViewBorder)
{
engine.smy += (screen->h - yViewBorder) - player.y;
player.y = screen->h - yViewBorder;
}
} }
else if (player.y > screen->h - yViewBorder) else if (currentGame.difficulty != DIFFICULTY_ORIGINAL)
{ {
engine.smy += (screen->h - yViewBorder) - player.y; cd = player.y - screen->h / 2;
player.y = screen->h - yViewBorder; if (cd < 0)
{
cc = MAX(cd / 10, MAX(0, engine.ssy) - cameraMaxSpeed);
player.y -= cc;
engine.smy -= cc;
}
else if (cd > 0)
{
cc = MIN(cd / 10, cameraMaxSpeed + MIN(0, engine.ssy));
player.y -= cc;
engine.smy -= cc;
}
} }
} }
else if (currentGame.difficulty != DIFFICULTY_ORIGINAL) else
{ {
cd = player.y - screen->h / 2; LIMIT(player.x, xViewBorder, screen->w - xViewBorder);
if (cd < 0) LIMIT(player.y, yViewBorder, screen->h - yViewBorder);
{
cc = MAX(cd / 10, MAX(0, engine.ssy) - cameraMaxSpeed);
player.y -= cc;
engine.smy -= cc;
}
else if (cd > 0)
{
cc = MIN(cd / 10, cameraMaxSpeed + MIN(0, engine.ssy));
player.y -= cc;
engine.smy -= cc;
}
} }
} }