Made camera centering more gentle.
This commit is contained in:
parent
8e753d9525
commit
5965f44bb1
|
@ -220,31 +220,17 @@ void doPlayer()
|
|||
if (cd < 0)
|
||||
{
|
||||
cc = engine.ssx - cameraMaxSpeed;
|
||||
if (cd < cc)
|
||||
{
|
||||
limitFloat(&cc, cd / 10, -cd / 10);
|
||||
player.x -= cc;
|
||||
engine.smx -= cc;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.x -= cd;
|
||||
engine.smx -= cd;
|
||||
}
|
||||
}
|
||||
else if (cd > 0)
|
||||
{
|
||||
cc = cameraMaxSpeed + engine.ssx;
|
||||
if (cd > cc)
|
||||
{
|
||||
limitFloat(&cc, -cd / 10, cd / 10);
|
||||
player.x -= cc;
|
||||
engine.smx -= cc;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.x -= cd;
|
||||
engine.smx -= cd;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ymoved)
|
||||
{
|
||||
|
@ -265,31 +251,17 @@ void doPlayer()
|
|||
if (cd < 0)
|
||||
{
|
||||
cc = engine.ssy - cameraMaxSpeed;
|
||||
if (cd < cc)
|
||||
{
|
||||
limitFloat(&cc, cd / 10, -cd / 10);
|
||||
player.y -= cc;
|
||||
engine.smy -= cc;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.y -= cd;
|
||||
engine.smy -= cd;
|
||||
}
|
||||
}
|
||||
else if (cd > 0)
|
||||
{
|
||||
cc = cameraMaxSpeed + engine.ssy;
|
||||
if (cd > cc)
|
||||
{
|
||||
limitFloat(&cc, -cd / 10, cd / 10);
|
||||
player.y -= cc;
|
||||
engine.smy -= cc;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.y -= cd;
|
||||
engine.smy -= cd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue